Skip to content

Commit

Permalink
Updated naming of github_token environment variable in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
uchendui committed Nov 25, 2023
1 parent 5c8c1e4 commit d5e6767
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions .github/workflows/auto-add-contributors.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
name: Automatically Add Contributors
on:
push:
branches:
- main
push:
branches:
- main
jobs:
update-contributors:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
update-contributors:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python3.11
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Installing GitHub CLI
run: |
sudo apt -y update && sudo apt -y upgrade
sudo apt -y install software-properties-common
sudo apt install -y gh jq nodejs npm
- name: Install python packages
run: |
python -m pip install --upgrade pip
pip install -r .github/workflows/contributors/requirements.txt
- name: Installing GitHub CLI
run: |
sudo apt -y update && sudo apt -y upgrade
sudo apt -y install software-properties-common
sudo apt install -y gh jq nodejs npm
- name: Install python packages
run: |
python -m pip install --upgrade pip
pip install -r .github/workflows/contributors/requirements.txt
- name: Auto add contributor job has been triggered
run: |
echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- name: Running Python Script to Update .all-contributorsrc
run: |
echo "Running Python Script to Update .all-contributorsrc"
python .github/workflows/contributors/update_contributors.py
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Using all-contributors CLI to update files
run: |
echo "Using all-contributors CLI to update files"
npm i -D all-contributors-cli
npx all-contributors generate
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Stash any changes made to the README.md and contributors.qmd files
git stash
# Fetch the latest state of the master branch and try to merge
git fetch origin main
git merge origin/main
# Pop the stashed changes
git stash pop
git add -u
git diff-index --quiet HEAD || git commit -m "Update readme and contributors.qmd with contributors"
git push
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Auto add contributor job has been triggered
run: |
echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- name: Running Python Script to Update .all-contributorsrc
run: |
echo "Running Python Script to Update .all-contributorsrc"
python .github/workflows/contributors/update_contributors.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Using all-contributors CLI to update files
run: |
echo "Using all-contributors CLI to update files"
npm i -D all-contributors-cli
npx all-contributors generate
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Stash any changes made to the README.md and contributors.qmd files
git stash
# Fetch the latest state of the master branch and try to merge
git fetch origin main
git merge origin/main
# Pop the stashed changes
git stash pop
git add -u
git diff-index --quiet HEAD || git commit -m "Update readme and contributors.qmd with contributors"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d5e6767

Please sign in to comment.