-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use github token for api calls; fix auto pr (#4)
* add auth to session header * update push branch name * minor change * change back to init * debug * debug * debug * debug * debug * debug * debug * debug * debug * debug * debug * debug
- Loading branch information
Showing
3 changed files
with
37 additions
and
29 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 |
---|---|---|
|
@@ -16,33 +16,34 @@ jobs: | |
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install pip -U | ||
pip install -r requirements.txt | ||
- name: Checkout a new branch | ||
- name: Setup branch name and gh config | ||
run: | | ||
TIMESTAMP=$(date -u "+%Y-%m-%d") | ||
BRANCH_NAME="update-software-info-${TIMESTAMP}" | ||
git checkout -b $BRANCH_NAME | ||
- name: Obtain latest software info summary | ||
run: python src/software_info.py | ||
# Export to env so that they can be accessed later | ||
echo "TIMESTAMP=$TIMESTAMP" >> $GITHUB_ENV | ||
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | ||
- name: Commit and push changes | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
git add software_info | ||
git commit -m "[${TIMESTAMP}] update software info" | ||
git push origin HEAD | ||
- name: Install dependencies | ||
run: | | ||
pip install pip -U | ||
pip install -r requirements.txt | ||
- name: Obtain latest software info summary | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: python src/software_info.py | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ env.BRANCH_NAME }} | ||
commit-message: "[${{ env.TIMESTAMP }}] update software info" | ||
title: "Automated software info update" | ||
body: "This is an auto-generated PR with updates to the software info." | ||
draft: false |
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
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