run get_discussions.py #6
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
name: run get_discussions.py | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: install python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: execute py script | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: python manage_discussions/get_discussions.py | |
- name: Create new branch with timestamp | |
run: | | |
BRANCH="update-blips-branch-$(date +%s)" | |
git checkout -b "$BRANCH" | |
echo "::set-output name=branch::$BRANCH" | |
- name: Commit changes (if any) | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add tech_radar/blips.json | |
git commit -m "Auto-update blips.json" || echo "No changes to commit" | |
- name: Push changes to new branch | |
run: | | |
git push origin $(echo ${{ steps.create_new_branch.outputs.branch }}) --force | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
branch: ${{ steps.create_new_branch.outputs.branch }} # The new branch created earlier | |
title: 'Auto-update blips.json' | |
body: 'This PR updates the blips.json file automatically.' | |
base: 'main' # Change this if your default branch is different (e.g., master) | |
labels: 'auto-update' |