5
5
inputs :
6
6
pr :
7
7
description : " Pull request number. Used to pull the proper branch ref, including on forks."
8
+ type : number
8
9
required : false
9
10
comment-id :
10
11
description : " Optional. The comment-id of the slash command. Used to update the comment with the status."
11
12
required : false
12
13
14
+ # These must be declared, but they are unused and ignored.
15
+ # TODO: Get 'repo' and 'gitref' from the PR on other workflows, so we can remove these.
16
+ repo :
17
+ description : " Repo (Ignored)"
18
+ required : false
19
+ default : " airbytehq/airbyte"
20
+ gitref :
21
+ description : " Ref (Ignored)"
22
+ required : false
23
+
13
24
run-name : " Fix formatting on PR #${{ github.event.inputs.pr }}"
14
25
concurrency :
15
26
group : ${{ github.workflow }}-${{ github.event.inputs.pr }}
@@ -21,30 +32,32 @@ jobs:
21
32
name : " Run airbyte-ci format fix all"
22
33
runs-on : ubuntu-latest
23
34
steps :
24
- - name : Checkout Airbyte
25
- uses : actions/checkout@v3
26
- with :
27
- # Important that this is set so that CI checks are triggered again
28
- # Without this we would be forever waiting on required checks to pass
29
- token : ${{ secrets.GH_PAT_APPROVINGTON_OCTAVIA }}
30
- fetch-depth : 1
31
-
32
- - name : Checkout PR (${{ github.event.inputs.pr }})
33
- uses : dawidd6/action-checkout-pr@v1
34
- with :
35
- pr : ${{ github.event.inputs.pr }}
36
-
37
35
- name : Get job variables
38
36
id : job-vars
39
37
env :
40
38
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41
39
shell : bash
42
40
run : |
43
41
PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr }})
44
- echo "::set-output name= repo:: $(echo "$PR_JSON" | jq -r .head.repo.full_name)"
45
- echo "::set-output name= branch:: $(echo "$PR_JSON" | jq -r .head.ref)"
42
+ echo "repo= $(echo "$PR_JSON" | jq -r .head.repo.full_name)" >> $GITHUB_OUTPUT
43
+ echo "branch= $(echo "$PR_JSON" | jq -r .head.ref)" >> $GITHUB_OUTPUT
46
44
echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
47
45
46
+ - name : Checkout Airbyte
47
+ uses : actions/checkout@v3
48
+ with :
49
+ repository : ${{ steps.job-vars.outputs.repo }}
50
+ ref : ${{ steps.job-vars.outputs.branch }}
51
+ fetch-depth : 1
52
+ # Important that token is a PAT so that CI checks are triggered again.
53
+ # Without this we would be forever waiting on required checks to pass.
54
+ token : ${{ secrets.GH_PAT_APPROVINGTON_OCTAVIA }}
55
+
56
+ # - name: Checkout PR (${{ github.event.inputs.pr }})
57
+ # uses: dawidd6/action-checkout-pr@v1
58
+ # with:
59
+ # pr: ${{ github.event.inputs.pr }}
60
+
48
61
- name : Append comment with job run link
49
62
# If not comment-id is provided, this will create a new
50
63
# comment with the job run link.
82
95
# Don't commit if we're on master
83
96
if : github.ref != 'refs/heads/master'
84
97
with :
98
+ repository : ${{ steps.job-vars.outputs.repo }}
85
99
commit_message : " chore: format code"
86
100
commit_user_name : Octavia Squidington III
87
101
commit_user_email :
[email protected]
0 commit comments