mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 12:10:20 +08:00
Bumps the actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [actions/download-artifact](https://github.com/actions/download-artifact) and [actions/create-github-app-token](https://github.com/actions/create-github-app-token). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) Updates `actions/download-artifact` from 4 to 5 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) Updates `actions/create-github-app-token` from 2.0.6 to 2.1.1 - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Commits](https://github.com/actions/create-github-app-token/compare/v2.0.6...v2.1.1) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/create-github-app-token dependency-version: 2.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
46 lines
1.9 KiB
YAML
46 lines
1.9 KiB
YAML
name: Update dependencies
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize, reopened, ready_for_review, labeled]
|
|
|
|
jobs:
|
|
update:
|
|
name: Update dependencies
|
|
timeout-minutes: 45
|
|
runs-on: macos-latest
|
|
if: contains(github.event.pull_request.labels.*.name, 'Update dependencies') && (github.event.pull_request.head.repo.full_name == 'github/codeql-action')
|
|
permissions:
|
|
contents: write # needed to push the updated dependencies
|
|
pull-requests: write # needed to comment on the PR
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Remove PR label
|
|
env:
|
|
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
REPOSITORY: '${{ github.repository }}'
|
|
PR_NUMBER: '${{ github.event.pull_request.number }}'
|
|
run: |
|
|
gh api "repos/$REPOSITORY/issues/$PR_NUMBER/labels/Update%20dependencies" -X DELETE
|
|
|
|
- name: Push updated dependencies
|
|
env:
|
|
BRANCH: '${{ github.head_ref }}'
|
|
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
run: |
|
|
git fetch origin "$BRANCH" --depth=1
|
|
git checkout "origin/$BRANCH"
|
|
.github/workflows/script/update-node-modules.sh update
|
|
if [ ! -z "$(git status --porcelain)" ]; then
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config --global user.name "github-actions[bot]"
|
|
git add node_modules
|
|
git commit -am "Update checked-in dependencies"
|
|
git push origin "HEAD:$BRANCH"
|
|
echo "Pushed a commit to update the checked-in dependencies." \
|
|
"Please mark the PR as ready for review to trigger PR checks." |
|
|
gh pr comment --body-file - --repo github/codeql-action "${{ github.event.pull_request.number }}"
|
|
gh pr ready --undo --repo github/codeql-action "${{ github.event.pull_request.number }}"
|
|
fi
|