Skip to content

Remove PR old association #271

Remove PR old association

Remove PR old association #271

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.12"
- name: Install Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: 2.1.3
- name: Get OPS token
id: ops_token
uses: ./.github/workflows/launchpad-token
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CUMULUS_OPS }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CUMULUS_OPS }}
lambda-function: ops-launchpad_token_dispenser
- name: Get UAT token
id: uat_token
uses: ./.github/workflows/launchpad-token
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CUMULUS_UAT }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CUMULUS_UAT }}
lambda-function: uat-launchpad_token_dispenser
- name: Run diff
env:
UAT_TOKEN_TEMP: ${{ steps.uat_token.outputs.result }}
OPS_TOKEN_TEMP: ${{ steps.ops_token.outputs.result }}
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