Skip to content

merge(#9): chore: save token to file #8

merge(#9): chore: save token to file

merge(#9): chore: save token to file #8

Workflow file for this run

name: Update AUTHORS.md on merge
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Run authors
run: yarn authors
- name: Check if AUTHORS.md has changed
run: |
if git status --porcelain | grep 'AUTHORS.md'; then
echo "CHANGED=true" >> $GITHUB_ENV
else
echo "CHANGED=false" >> $GITHUB_ENV
fi
echo "CHANGED is $CHANGED"
- name: Create and push a PR
if: env.CHANGED == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update AUTHORS.md"
title: "chore: update AUTHORS.md"
body: "This PR updates the AUTHORS.md file."
branch: feat/update-authors-md
base: main
- name: Login and merge PR with gh
if: env.CHANGED == 'true'
run: |
echo ${{ secrets.GITHUB_TOKEN }} > token.txt
gh auth login --with-token < token.txt
gh pr merge --auto --squash --delete-branch