Skip to content

Scan For New Associations #14

Scan For New Associations

Scan For New Associations #14

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Scan For New Associations
# Controls when the workflow will run
on: workflow_dispatch
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
find_new:
name: Find new associations
# The type of runner that the job will run on
runs-on: ubuntu-latest
outputs:
new_uat_associations: ${{ steps.diff.outputs.new_uat_associations }}
new_ops_associations: ${{ steps.diff.outputs.new_ops_associations }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.5.1
- name: Run diff
id: diff
env:
UAT_TOKEN_TEMP: ${{ secrets.UAT_TOKEN_TEMP }}
run: |
poetry install
# echo "new_uat_associations=$(poetry run cmr_association_diff -e uat -t service -p POCLOUD -n 'PODAAC L2 Cloud Subsetter' -a $GITHUB_WORKSPACE/cmr/uat_associations.txt --token $UAT_TOKEN_TEMP)" >> $GITHUB_OUTPUT
# echo "new_ops_associations=$(poetry run cmr_association_diff -e ops -t service -p POCLOUD -n 'PODAAC L2 Cloud Subsetter' -a $GITHUB_WORKSPACE/cmr/ops_associations.txt --token $OPS_TOKEN_TEMP)" >> $GITHUB_OUTPUT
echo "new_uat_associations=[\"C1238687534-POCLOUD\"]" >> $GITHUB_OUTPUT
echo "new_ops_associations=[\"C1245295750-POCLOUD\"]" >> $GITHUB_OUTPUT
open_pr_uat:
needs: find_new
strategy:
fail-fast: false
max-parallel: 2
matrix:
concept_id: ${{ fromJson(needs.find_new.outputs.new_uat_associations) }}
runs-on: ubuntu-latest
name: UAT ${{ matrix.concept_id }}
steps:
- uses: actions/checkout@v3
- name: Update uat_associations
run: echo "${{ matrix.concept_id }}" >> $GITHUB_WORKSPACE/cmr/uat_associations.txt
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
commit-message: Add ${{ matrix.concept_id }}
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: ${{ matrix.concept_id }}
delete-branch: true
title: UAT ${{ matrix.concept_id }}
body: |
New association between l2ss-py and ${{ matrix.concept_id }} found in UAT.
Beginning verification of collection.
labels: |
unverified
new collection
open_pr_ops:
needs: find_new
strategy:
fail-fast: false
max-parallel: 2
matrix:
concept_id: ${{ fromJson(needs.find_new.outputs.new_ops_associations) }}
runs-on: ubuntu-latest
name: OPS ${{ matrix.concept_id }}
steps:
- uses: actions/checkout@v3
- name: Update ops_associations
run: echo "${{ matrix.concept_id }}" >> $GITHUB_WORKSPACE/cmr/ops_associations.txt
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
commit-message: Add ${{ matrix.concept_id }}
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: ${{ matrix.concept_id }}
delete-branch: true
title: OPS ${{ matrix.concept_id }}
body: |
New association between l2ss-py and ${{ matrix.concept_id }} found in OPS.
Beginning verification of collection.
labels: |
unverified
new collection