Skip to content

good-first-issues

good-first-issues #174

Workflow file for this run

name: good-first-issues
on:
pull_request: []
workflow_dispatch:
schedule:
- cron: 5 20 * * *
push:
branches:
- main
jobs:
good-first-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update Repos
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/scripts/add-repos.py
# This is customized from the action to not add a body
- name: Generate First Issues
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -rf docs/_issues
mkdir -p docs/_issues
python .github/scripts/generate-first-issues.py
- name: Update Repository
if: (github.event_name != 'pull_request')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPDATE_BRANCH: "main"
run: |
printf "GitHub Actor: ${GITHUB_ACTOR}\n"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git branch
printf "Branch to push to is ${UPDATE_BRANCH}\n"
git checkout ${UPDATE_BRANCH} || git checkout -b ${UPDATE_BRANCH}
git branch
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git pull origin ${UPDATE_BRANCH}
git add docs/*
git add docs/_issues/*
git add .github/repos.txt
git add .github/empty.txt
if git diff-index --quiet HEAD --; then
printf "No changes\n"
else
printf "Changes\n"
git commit -a -m "Automated deployment to update first issues $(date '+%Y-%m-%d')"
git push origin ${UPDATE_BRANCH}
fi