Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use token to get push permission in dependabot-post workflow #102

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/dependabot-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# npm dependencies change. This workflow runs on dependabot branches, and runs
# a script that makes the necessary update after each dependabot push.
name: Dependabot-post

on:
push:
branches:
Expand All @@ -11,6 +12,7 @@ jobs:
update_npm_deps_hash:
name: Update NPM dependencies hash
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
steps:
- name: Check Out Code
uses: actions/checkout@v3
Expand All @@ -26,8 +28,11 @@ jobs:

- name: Set up Git Config
run: |
git config user.name 'GitHub Actions Bot'
git config user.email '<>'
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# NOTE: Prefixing/appending commit messages with `[dependabot skip]`
# allows dependabot to rebase/update the pull request, force-pushing
Expand Down