File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 working-directory : 04-advanced-features/caching/minimal-node-project
5353
5454 steps :
55- - uses : actions/checkout@v4
55+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5656 - uses : actions/setup-node@v4
5757 with :
5858 node-version : 20
Original file line number Diff line number Diff line change 4040 pull-requests : read # Can read PR data only
4141 continue-on-error : true # Avoids failing entire workflow
4242 steps :
43- - uses : actions/checkout@v4
43+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4444
4545 - name : Install GitHub CLI
4646 run : |
@@ -50,11 +50,11 @@ jobs:
5050 - name : List the first 5 open PRs (allowed)
5151 run : gh pr list --limit 5
5252 env :
53- GH_TOKEN : ${{ github.token }}
53+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5454
5555 - name : Attempt to add a label (expected to fail)
5656 env :
57- GH_TOKEN : ${{ github.token }}
57+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5858 run : |
5959 gh pr edit 1 --add-label "documentation"
6060
6767 permissions :
6868 pull-requests : write
6969 steps :
70- - uses : actions/checkout@v4
70+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7171
7272 - name : Install GitHub CLI
7373 run : |
7676
7777 - name : Attempt to add a label (expected to succeed)
7878 env :
79- GH_TOKEN : ${{ github.token }}
79+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8080 run : |
8181 gh pr edit 1 --add-label "documentation"
82- - name : Confirm the
83-
82+ - name : Confirm the
8483 if : success()
85- run : echo "✅ Write operation succeeded!"
84+ run : echo "✅ Write operation succeeded!"
Original file line number Diff line number Diff line change 11name : Composite Action Demo
2-
32on :
43 workflow_dispatch :
54
87 runs-on : ubuntu-24.04
98 name : One usage of the composite action
109 steps :
11- - uses : actions/checkout@v4
10+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1211 - id : composite-action-instance
1312 uses : ./06-authoring-actions/composite-action
1413 with :
@@ -17,12 +16,11 @@ jobs:
1716 RANDOM_NUMBER : ${{ steps.composite-action-instance.outputs.random-number }}
1817 run : echo random-number "$RANDOM_NUMBER"
1918 shell : bash
20-
2119 hello-world-2 :
2220 runs-on : ubuntu-24.04
2321 name : Another usage of the composite action
2422 steps :
25- - uses : actions/checkout@v4
23+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2624 - id : composite-action-instance
2725 uses : ./06-authoring-actions/composite-action
2826 with :
You can’t perform that action at this time.
0 commit comments