Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 16 additions & 2 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,33 @@ jobs:
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

# Sample dependency updates need a human until changed samples can be
# tested without exposing deployment credentials to Dependabot PRs.
- name: Check whether sample files changed
id: scope
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
files=$(gh api --paginate --slurp "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/files?per_page=100")
safe=$(jq '[.[][] | select(.filename | startswith("samples/"))] | length == 0' <<< "$files")
echo "safe=$safe" >> "$GITHUB_OUTPUT"

- name: Approve patch and minor updates
if: |
steps.scope.outputs.safe == 'true' && (
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
steps.metadata.outputs.update-type == 'version-update:semver-minor')
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge for patch and minor updates
if: |
steps.scope.outputs.safe == 'true' && (
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
steps.metadata.outputs.update-type == 'version-update:semver-minor')
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/test-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ permissions:

on:
pull_request:
paths:
- "scripts/**"
- "templates/**"
- "samples/**/compose.yaml"
- "samples/**/compose.yml"
push:
branches:
- main
Expand Down Expand Up @@ -66,3 +61,16 @@ jobs:
script: |
const script = require('./scripts/template-manager.js')
await script({github, context, core});

ci:
name: ci
if: always() && github.event_name == 'pull_request'
needs: [test, preview-workflows]
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Require script tests and workflow preview
env:
TEST: ${{ needs.test.result }}
PREVIEW: ${{ needs.preview-workflows.result }}
run: test "$TEST" = success && test "$PREVIEW" = success
Loading