Skip to content

changed method to retrieve PRs #5

changed method to retrieve PRs

changed method to retrieve PRs #5

name: Update Shortnames for all PRs
on:
workflow_dispatch:
# schedule:
# - cron: '00 5 * * *'
jobs:
update_shortnames:
runs-on: ubuntu-latest
name: Update shortnames for PRs without shortnames
steps:
- uses: getsentry/action-github-app-token@v2
name: Get GH App token
id: podaac-cicd
with:
app_id: ${{ secrets.CICD_APP_ID }}
private_key: ${{ secrets.CICD_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.podaac-cicd.outputs.token }}
- name: Retrieve UAT and OPS metadata
run: |
curl "https://cmr.earthdata.nasa.gov/search/collections.umm_json?service_name=PODAAC%20L2%20Cloud%20Subsetter&page_size=2000&token=${{ secrets.LAUNCHPAD_TOKEN_OPS }}" >cmr_metadata.json

Check failure on line 26 in .github/workflows/update_shortnames.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update_shortnames.yml

Invalid workflow file

You have an error in your yaml syntax on line 26
- name: retrieve list of open PRs
env:
GH_TOKEN: ${{ steps.podaac-cicd.outputs.token }}
run: |
gh pr list --state open --label autotest --limit 500 >branches.list
cat branches.list|grep diff\/ |sed 's|^.*diff/|diff/|g' |sed 's|\t.*||g' >branches2.list
while read prname; do
echo "$prname"
# COLLECTION_ID=$(echo ${{ github.event.pull_request.title }} |sed -E 's/[A-Z+] //' |sed -E 's/ \(.*//' )
# cd $GITHUB_WORKSPACE
# SHORT_NAME=$(cat cmr_metadata.json | jq -r '.items[] | select(.meta."concept-id" == "$COLLECTION_ID")' |jq -r '.umm.ShortName')
# echo "SHORT_NAME=$SHORT_NAME">>$GITHUB_ENV
done <branches2.list