mirror of
https://github.com/Swatinem/rust-cache
synced 2026-06-04 00:07:55 +00:00
Bumps the actions group with 3 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [taiki-e/install-action](https://github.com/taiki-e/install-action) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action). Updates `actions/checkout` from 6.0.2 to 6.0.3 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](de0fac2e45...df4cb1c069) Updates `taiki-e/install-action` from 2.77.6 to 2.81.3 - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](c070f87102...25435dc8dd) Updates `zizmorcore/zizmor-action` from 0.5.3 to 0.5.6 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](b1d7e1fb5d...5f14fd08f7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: taiki-e/install-action dependency-version: 2.81.3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.5.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
65 lines
2.7 KiB
YAML
65 lines
2.7 KiB
YAML
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enabling-automerge-on-a-pull-request
|
|
|
|
name: Dependabot Automation
|
|
on: pull_request
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
automerge:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # for pushing commits
|
|
pull-requests: write # for merging PRs
|
|
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'Swatinem/rust-cache'
|
|
steps:
|
|
- name: Fetch metadata
|
|
id: metadata
|
|
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
|
|
with:
|
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
fetch-depth: 2
|
|
persist-credentials: false
|
|
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
|
|
- name: Check if package-lock.json has been changed
|
|
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
|
|
id: npm
|
|
env:
|
|
PR_URL: ${{github.event.pull_request.html_url}}
|
|
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
run: |
|
|
if ! git diff --quiet HEAD~1.. -- package-lock.json; then
|
|
echo "changed=true" >> $GITHUB_OUTPUT
|
|
echo "changed=true, checking out $PR_URL to allow amend"
|
|
gh pr checkout "$PR_URL"
|
|
fi
|
|
- name: Setup node if necessary
|
|
if: steps.npm.outputs.changed != ''
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 24.x
|
|
cache: npm
|
|
- name: Re-generate and commit dist/ if changed
|
|
id: amend
|
|
if: steps.npm.outputs.changed != ''
|
|
run: |
|
|
npm ci
|
|
npm run prepare
|
|
if ! git diff --quiet dist/*/index.js; then
|
|
echo "dist/ changed, amending last commit"
|
|
export $(git log -1 --pretty=format:'GIT_COMMITTER_NAME=%cn GIT_COMMITTER_EMAIL=%ce GIT_AUTHOR_NAME=%an GIT_AUTHOR_EMAIL=%ae')
|
|
git fetch --unshallow
|
|
echo "Before amend:" && git show --name-only --pretty=
|
|
git commit --amend --no-edit --no-reset-author -- dist/*/index.js
|
|
echo "After amend:" && git show --name-only --pretty=
|
|
git push --force-with-lease origin HEAD
|
|
echo "changed=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Auto-merge Patch PRs
|
|
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
|
|
run: gh pr merge --auto --merge "$PR_URL"
|
|
env:
|
|
PR_URL: ${{github.event.pull_request.html_url}}
|
|
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|