File tree 4 files changed +48
-0
lines changed
actions/post-log-to-slack
4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Container image that runs your code
2
+ FROM alpine:3.10
3
+
4
+ # Copies your code file from your action repository to the filesystem path `/` of the container
5
+ COPY entrypoint.sh /entrypoint.sh
6
+
7
+ # Code file to execute when the docker container starts up (`entrypoint.sh`)
8
+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ # action.yml
2
+ name : ' Hello World'
3
+ description : ' Greet someone and record the time'
4
+ inputs :
5
+ who-to-greet : # id of input
6
+ description : ' Who to greet'
7
+ required : true
8
+ default : ' World'
9
+ outputs :
10
+ time : # id of output
11
+ description : ' The time we greeted you'
12
+ runs :
13
+ using : ' docker'
14
+ image : ' Dockerfile'
15
+ args :
16
+ - ${{ inputs.who-to-greet }}
Original file line number Diff line number Diff line change
1
+ #! /bin/sh -l
2
+
3
+ echo " Hello $1 "
4
+ time=$( date)
5
+ echo " time=$time " >> $GITHUB_OUTPUT
6
+
Original file line number Diff line number Diff line change
1
+ name : Post log to Slack
2
+ on :
3
+ push :
4
+ branches : ["main"]
5
+
6
+ jobs :
7
+ hello_world_job :
8
+ runs-on : ubuntu-latest
9
+ name : A job to say hello
10
+ steps :
11
+ - name : Hello world action step
12
+ id : hello
13
+ uses : actions/post-log-to-slack
14
+ with :
15
+ who-to-greet : " Mona the Octocat"
16
+ # Use the output from the `hello` step
17
+ - name : Get the output time
18
+ run : echo "The time was ${{ steps.hello.outputs.time }}"
You can’t perform that action at this time.
0 commit comments