Skip to content

Updating archives list #4

Updating archives list

Updating archives list #4

name: update-archives-list-pr
run-name: Updating archives list
on:
workflow_dispatch:
push:
schedule:
- cron: '0 0 * * 0'
jobs:
run-archive-script:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: install python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: install pyvo and required dependencies
run: |
python -m ensurepip --upgrade
pip install astropy
pip install requests
pip install pyvo
- name: create temp PR branch
run: |
DATE=$(date +'%Y%m%d')
BRANCH_NAME="archives-update-pr-${DATE}"
git checkout -b $BRANCH_NAME
git push origin $BRANCH_NAME
- name: run archives script
run: python fetch_archives.py
- name: List files after script execution
run: ls -la
- name: create pull request
run: |
DATE=$(date +'%Y%m%d')
BRANCH_NAME="archives-update-pr-${DATE}"
gh pr create -B main -H $BRANCH_NAME --title 'Archives list update' --body 'Automated pull request for archives list update'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}