Repository navigation
ci: automate CodeQL and action dependency merges #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
269ead4
ci: run CodeQL for dependency pull requests
polaz 9ce556f
ci: auto-merge verified action dependency updates
polaz 8951e0f
ci: name the required auto-merge admission gate
polaz 8d6d6e0
fix(ci): authorize bot merges in trusted context
polaz 879c5c8
fix(ci): bind bot admission to the PR head
polaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: CodeQL | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '27 3 * * 2' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: [actions, javascript-typescript, rust] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@793b778da9c9275a0f276522b27cb5fc14bba279 # v4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: none | ||
| - name: Analyze | ||
| uses: github/codeql-action/analyze@793b778da9c9275a0f276522b27cb5fc14bba279 # v4 | ||
| with: | ||
| category: /language:${{ matrix.language }} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Dependabot auto-merge | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| types: [opened, reopened, synchronize] | ||
| pull_request_target: | ||
| branches: [main] | ||
| types: [opened, reopened, synchronize] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| enable: | ||
| name: Dependabot auto-merge admission | ||
| if: >- | ||
| github.repository == 'structured-world/omloom' && | ||
| github.event.pull_request.user.login == 'dependabot[bot]' && | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| # This privileged workflow never checks out or executes pull-request code. | ||
| # Metadata must come from signed Dependabot commits in this repository. | ||
| - name: Verify Dependabot metadata | ||
| id: metadata | ||
| uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2 | ||
| # pull_request records the required check on the PR head. The trusted | ||
| # target run repeats admission before it can authorize the native merge. | ||
| - name: Verify every commit | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_REPO: ${{ github.repository }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| run: | | ||
| # The metadata action validates the first commit. Reject any later | ||
| # unsigned or human-authored addition before enabling native auto-merge. | ||
| gh api --paginate --slurp "repos/$GH_REPO/pulls/$PR_NUMBER/commits" | | ||
| jq -e '([.[][]] | length) > 0 and all(.[][]; .author.login == "dependabot[bot]" and .commit.verification.verified == true)' > /dev/null | ||
| - name: Enable auto-merge for GitHub Actions updates | ||
| if: >- | ||
| github.event_name == 'pull_request_target' && | ||
| steps.metadata.outputs.package-ecosystem == 'github_actions' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| run: | | ||
| gh pr merge "$PR_URL" --auto --squash --match-head-commit "$PR_HEAD_SHA" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.