Skip to content

Remove PR old association #24

Remove PR old association

Remove PR old association #24

Workflow file for this run

# Run every third day starting from the 2nd of the month 4 am pacific
name: Remove PR old association
on:
workflow_dispatch:
schedule:
- cron: '0 11 2-31/3 * *'
jobs:
find_new:
name: Find new associations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.5.1
- name: Run diff
env:
UAT_TOKEN_TEMP: ${{ secrets.LAUNCHPAD_TOKEN_UAT }}
OPS_TOKEN_TEMP: ${{ secrets.LAUNCHPAD_TOKEN_OPS }}
run: |
poetry install
ls $GITHUB_WORKSPACE/tests/cmr/concise/uat/ > $GITHUB_WORKSPACE/tests/cmr/concise/uat_associations.txt
ls $GITHUB_WORKSPACE/tests/cmr/concise/ops/ > $GITHUB_WORKSPACE/tests/cmr/concise/ops_associations.txt
poetry run cmr_association_diff -e uat -t service -p POCLOUD -n 'PODAAC Concise' -a $GITHUB_WORKSPACE/tests/cmr/concise/uat_associations.txt --token $UAT_TOKEN_TEMP > $GITHUB_WORKSPACE/tests/cmr/concise/new_uat_associations.txt
poetry run cmr_association_diff -e ops -t service -p POCLOUD -n 'PODAAC Concise' -a $GITHUB_WORKSPACE/tests/cmr/concise/ops_associations.txt --token $OPS_TOKEN_TEMP > $GITHUB_WORKSPACE/tests/cmr/concise/new_ops_associations.txt
poetry run python tests/collection_names.py --env uat --token $UAT_TOKEN_TEMP --file $GITHUB_WORKSPACE/tests/cmr/concise/new_uat_associations.txt
poetry run python tests/collection_names.py --env ops --token $OPS_TOKEN_TEMP --file $GITHUB_WORKSPACE/tests/cmr/concise/new_ops_associations.txt
rm $GITHUB_WORKSPACE/tests/cmr/concise/uat_associations.txt
rm $GITHUB_WORKSPACE/tests/cmr/concise/ops_associations.txt
rm $GITHUB_WORKSPACE/tests/cmr/concise/new_uat_associations.txt
rm $GITHUB_WORKSPACE/tests/cmr/concise/new_ops_associations.txt
- name: Remove Old prs
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
poetry run python tests/remove_prs.py