Skip to content

Commit

Permalink
fix: constants pr workflow to keep all steps under the same job
Browse files Browse the repository at this point in the history
GH Actions workflows keep job isolated so they share same shell
so all the context is gone so merging all steps into single job.
  • Loading branch information
koladilip committed Dec 10, 2024
1 parent 56831b3 commit 777e5d3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/raise-pr-for-constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ env:
DEST_PATH: packages/analytics-js-common/src/constants/integrations/Destinations.ts

jobs:
check_changes:
check_changes_and_raise_pr:
runs-on: ubuntu-latest
outputs:
pr_required: ${{ steps.compare_files.outputs.pr_required }}
steps:
- name: Checkout Source Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -46,12 +44,8 @@ jobs:
echo "pr_required=true" >> $GITHUB_OUTPUT
fi
raise_pr:
needs: check_changes
if: needs.check_changes.outputs.pr_required == 'true'
runs-on: ubuntu-latest
steps:
- name: Commit and Push Changes
if: steps.compare_files.outputs.pr_required == 'true'
run: |
cd dest-repo
cp "../generated/Destinations.ts" "packages/analytics-js-common/src/constants/integrations/Destinations.ts"
Expand All @@ -60,6 +54,7 @@ jobs:
git push origin ${{ env.BRANCH_NAME }}
- name: Create or Update PR
if: steps.compare_files.outputs.pr_required == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down

0 comments on commit 777e5d3

Please sign in to comment.