@@ -4,30 +4,30 @@ name: validate-blogpost
44on :
55 pull_request_target :
66 branches :
7- - master
7+ - ' master'
8+
9+ permissions :
10+ actions : read
11+ checks : read
12+ contents : read
13+ deployments : read
14+ issues : write
15+ discussions : read
16+ packages : read
17+ pages : read
18+ pull-requests : write
19+ repository-projects : write
20+ security-events : read
21+ statuses : read
822
923jobs :
1024 pull-and-run-blogpost-checker-image :
1125 runs-on : ubuntu-latest
12- permissions :
13- actions : read
14- checks : read
15- contents : read
16- deployments : read
17- id-token : read
18- issues : write
19- discussions : read
20- packages : read
21- pages : read
22- pull-requests : write
23- repository-projects : write
24- security-events : read
25- statuses : read
2626
2727 steps :
2828 - name : Inject env
2929 uses :
rlespinasse/[email protected] 30-
30+
3131 - uses : actions/checkout@v2
3232
3333 - name : git log
@@ -42,18 +42,36 @@ jobs:
4242 echo "::set-env name=BASE_COMMIT::$BASE_COMMIT"
4343 env :
4444 ACTIONS_ALLOW_UNSECURE_COMMANDS : ' true'
45-
45+
4646 - uses : actions/checkout@v2
4747 with :
4848 repository : ${{ github.event.pull_request.user.login }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}
4949 ref : ${{ env.HEAD_COMMIT }}
5050 fetch-depth : 0
51-
51+
5252 - run : |
5353 echo github.event.number = ${{ github.event.number }}
5454 echo github.event.pull_request.number = ${{ github.event.pull_request.number }}
5555 echo github.event.issue.number = ${{ github.event.issue.number }}
5656
57+ - name : Create comment using REST API
58+ run : |
59+ curl --request POST \
60+ --url https://api.github.com/repos/adessoSE/devblog/issues/${{ github.event.number }}/comments \
61+ --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
62+ --header 'content-type: application/json' \
63+ --header 'accept: application/vnd.github.v3+json' \
64+ --data '{"body": "This is a test to create an issue comment via API."}' \
65+ --fail
66+
5767 - name : Run Docker image
58- run : docker run --env BASE_COMMIT='${{ env.BASE_COMMIT }}' --env HEAD_COMMIT='${{ env.HEAD_COMMIT }}' --env LOCAL_REPO_PATH=repo --env PR_NUMBER='${{ github.event.number }}' --env TOKEN=${{ secrets.GITHUB_TOKEN }} -v /home/runner/work/devblog/devblog:/repo jekyll2cms/blogpost-checker:1.0.12
68+ run : |
69+ docker run \
70+ --env BASE_COMMIT='${{ env.BASE_COMMIT }}' \
71+ --env HEAD_COMMIT='${{ env.HEAD_COMMIT }}' \
72+ --env LOCAL_REPO_PATH=repo \
73+ --env PR_NUMBER='${{ github.event.number }}' \
74+ --env TOKEN='${{ secrets.GITHUB_TOKEN }}' \
75+ -v /home/runner/work/devblog/devblog:/repo \
76+ jekyll2cms/blogpost-checker:1.0.12
5977
0 commit comments