Skip to content

Commit 776a19d

Browse files
author
Michael Smith
authored
fix: fix permissions on cli workflow (#1954)
ci expected to fail, have to merge to actually test
1 parent cad232f commit 776a19d

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/update-cli.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
update-cli:
1212
outputs:
1313
has_changes: ${{ steps.status.outputs.has_changes }}
14+
permissions:
15+
contents: write
1416
name: Update CLI
1517
if: github.repository_owner == 'npm'
1618
runs-on: ubuntu-latest
@@ -43,7 +45,7 @@ jobs:
4345
id: status
4446
run: |
4547
if [ -n "$(git status --porcelain)" ]; then
46-
echo "::set-output name=has_changes::1"
48+
echo "has_changes=1" >> "$GITHUB_OUTPUT"
4749
fi
4850
- name: Check in source updates
4951
if: steps.status.outputs.has_changes == '1'
@@ -55,4 +57,9 @@ jobs:
5557
publish:
5658
needs: update-cli
5759
if: needs.update-cli.outputs.has_changes == '1'
60+
permissions:
61+
contents: read
62+
pages: write
63+
id-token: write
64+
actions: read
5865
uses: ./.github/workflows/publish.yml

cli/scripts/template-oss/update-cli-yml.hbs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
update-cli:
1010
outputs:
1111
has_changes: $\{{ steps.status.outputs.has_changes }}
12+
permissions:
13+
contents: write
1214
{{> jobYml jobName="Update CLI" }}
1315
- name: Build documentation
1416
run: npm run build -w cli
@@ -20,7 +22,7 @@ jobs:
2022
id: status
2123
run: |
2224
if [ -n "$(git status --porcelain)" ]; then
23-
echo "::set-output name=has_changes::1"
25+
echo "has_changes=1" >> "$GITHUB_OUTPUT"
2426
fi
2527
- name: Check in source updates
2628
if: steps.status.outputs.has_changes == '1'
@@ -32,4 +34,9 @@ jobs:
3234
publish:
3335
needs: update-cli
3436
if: needs.update-cli.outputs.has_changes == '1'
37+
permissions:
38+
contents: read
39+
pages: write
40+
id-token: write
41+
actions: read
3542
uses: ./.github/workflows/publish.yml

0 commit comments

Comments
 (0)