Skip to content

Commit

Permalink
fix(actions): add permissions (#1363)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Sep 8, 2022
1 parent 5ab222b commit cbb2b39
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/npm-audit-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
npm-audit-fix:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: ybiquitous/npm-audit-fix-action@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/npm-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
post-comment:
if: ${{ contains(github.head_ref, 'dependabot/npm_and_yarn/') }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: ybiquitous/npm-diff-action@v1
23 changes: 23 additions & 0 deletions test/__snapshots__/init.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ on:
jobs:
npm-audit-fix:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: ybiquitous/npm-audit-fix-action@v4
Expand All @@ -174,6 +177,26 @@ jobs:
"
`;

exports[`write ".github/workflows/npm-diff.yml" 1`] = `
"name: npm diff
on:
pull_request:
types: [assigned]
jobs:
post-comment:
if: \${{ contains(github.head_ref, 'dependabot/npm_and_yarn/') }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: ybiquitous/npm-diff-action@v1
"
`;

exports[`write ".github/workflows/release.yml" 1`] = `
"name: Release
Expand Down
1 change: 1 addition & 0 deletions test/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ test('update "package.json" without fields', () =>
".editorconfig",
".remarkignore",
".github/workflows/npm-audit-fix.yml",
".github/workflows/npm-diff.yml",
".github/workflows/release.yml",
".github/workflows/test.yml",
".husky/commit-msg",
Expand Down

0 comments on commit cbb2b39

Please sign in to comment.