Skip to content

Commit

Permalink
Adjust auto-merge workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
SBence committed Jul 22, 2024
1 parent cca2cfd commit 92dc596
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ updates:
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build project

on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "*"
cache: "yarn"

- name: Install dependencies
run: yarn install

- name: Downcase repository owner
run: |
echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_ENV"
- name: Build project
run: yarn run build --base=/${{ github.event.repository.name }}/
env:
PUBLIC_URL: https://${{ env.REPOSITORY_OWNER }}.github.io/${{ github.event.repository.name }}/
34 changes: 4 additions & 30 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check PRs, merge Dependabot updates
name: Auto-merge Dependabot updates

on: pull_request

Expand All @@ -7,44 +7,18 @@ permissions:
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "*"
cache: "yarn"

- name: Install dependencies
run: yarn install

- name: Downcase repository owner
run: |
echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_ENV"
- name: Build project
run: yarn run build --base=/${{ github.event.repository.name }}/
env:
PUBLIC_URL: https://${{ env.REPOSITORY_OWNER }}.github.io/${{ github.event.repository.name }}/

merge:
needs: build
enable-auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'

steps:
- name: Dependabot metadata
- name: Fetch metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs
- name: Enable auto-merge
if: contains(fromJSON('["version-update:semver-minor", "version-update:semver-patch"]'), steps.metadata.outputs.update-type)
run: gh pr merge --auto --rebase "$PR_URL"
env:
Expand Down

0 comments on commit 92dc596

Please sign in to comment.