ORRC global attrs add DOI #111
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Dependabot CI Updates | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - synchronize | |
| permissions: | |
| contents: read | |
| jobs: | |
| dependabot-auto-approve: | |
| name: Auto-approve and auto-merge safe Dependabot updates | |
| environment: automation | |
| runs-on: ubuntu-latest | |
| if: > | |
| github.event.pull_request.user.login == 'dependabot[bot]' && | |
| contains(github.event.pull_request.labels.*.name, 'dependencies') | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| disable-sudo: true | |
| egress-policy: audit | |
| - name: Generate GitHub App token | |
| id: token_generator | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| app-id: ${{ secrets.OURANOS_HELPER_BOT_ID }} | |
| private-key: ${{ secrets.OURANOS_HELPER_BOT_KEY }} | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Fetch Dependabot metadata | |
| id: dependabot-metadata | |
| uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0 | |
| with: | |
| github-token: ${{ steps.token_generator.outputs.token }} | |
| - name: Stop workflow if not minor update or patch update | |
| id: skip-condition | |
| if: > | |
| steps.dependabot-metadata.outputs.update-type != 'version-update:semver-minor' && | |
| steps.dependabot-metadata.outputs.update-type != 'version-update:semver-patch' | |
| run: | | |
| echo "Not a minor or patch update; skipping auto-approval." | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| - name: Checkout Repository | |
| if: steps.skip-condition.outputs.skip != 'true' | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| token: ${{ steps.token_generator.outputs.token }} | |
| persist-credentials: false | |
| - name: Approve Changes | |
| if: > | |
| steps.skip-condition.outputs.skip != 'true' && | |
| !contains(github.event.pull_request.labels.*.name, 'approved') | |
| run: | | |
| gh pr review --approve "$PR_URL" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.token_generator.outputs.token }} | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| - name: Enable auto-merge on Pull Request | |
| if: steps.skip-condition.outputs.skip != 'true' | |
| run: | | |
| gh pr merge --auto --merge "$PR_URL" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.token_generator.outputs.token }} | |
| PR_URL: ${{ github.event.pull_request.html_url }} |