-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f06200d
commit 9d510a7
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,67 @@ | ||
name: ESLint Fix | ||
on: pull_request | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
if: ${{ steps.metadata.outputs.dependency-group == 'eslint' }} | ||
- name: Use Node.js 14.x | ||
uses: actions/setup-node@v1 | ||
if: ${{ steps.metadata.outputs.dependency-group == 'eslint' }} | ||
with: | ||
node-version: 14 | ||
- name: Install | ||
run: npm ci | ||
if: ${{ steps.metadata.outputs.dependency-group == 'eslint' }} | ||
- name: Lint Fix | ||
run: npm run lint-fix | ||
if: ${{ steps.metadata.outputs.dependency-group == 'eslint' }} | ||
- name: Create Pull Request | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v5 | ||
if: ${{ steps.metadata.outputs.dependency-group == 'eslint' }} | ||
with: | ||
path: ./ | ||
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | ||
commit-message: ESLint --fix | ||
committer: openactive-bot <[email protected]> | ||
author: openactive-bot <[email protected]> | ||
signoff: false | ||
branch: ci/eslint | ||
delete-branch: true | ||
title: 'ESLint fix' | ||
body: | | ||
Lint fixes based on the latest version of ESLint. | ||
labels: | | ||
automated pr | ||
draft: false | ||
- name: Auto-approve PR | ||
uses: hmarr/auto-approve-action@v3 | ||
if: ${{ steps.metadata.outputs.dependency-group == 'eslint' }} | ||
with: | ||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
- name: Enable Pull Request Automerge | ||
if: steps.cpr.outputs.pull-request-operation == 'created' && steps.metadata.outputs.dependency-group == 'eslint' | ||
uses: peter-evans/enable-pull-request-automerge@v3 | ||
with: | ||
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | ||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
merge-method: squash | ||
|
||
- name: Check outputs | ||
run: | | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |