-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat.path-params-http
- Loading branch information
Showing
42 changed files
with
1,762 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Raise PR for Destination Constants | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
env: | ||
BRANCH_NAME: fix/gh-update-destinations-ts | ||
SRC_FILE: generated/Destinations.ts | ||
DEST_PATH: packages/analytics-js-common/src/constants/integrations/Destinations.ts | ||
|
||
jobs: | ||
check_changes_and_raise_pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Source Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: develop | ||
|
||
- name: Checkout Destination Repo | ||
run: | | ||
git clone https://github.com/rudderlabs/rudder-sdk-js.git dest-repo || exit 1 | ||
cd dest-repo | ||
git checkout ${{ env.BRANCH_NAME }} || git checkout -b ${{ env.BRANCH_NAME }} | ||
- name: Compare Destinations.ts | ||
id: compare_files | ||
run: | | ||
if cmp -s "${{ env.SRC_FILE }}" "dest-repo/${{ env.DEST_PATH }}"; then | ||
echo "No changes detected." | ||
echo "pr_required=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "Changes detected." | ||
echo "pr_required=true" >> $GITHUB_OUTPUT | ||
fi | ||
- 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" | ||
git add packages/analytics-js-common/src/constants/integrations/Destinations.ts | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git config --global url."https://${{ secrets.PAT }}@github.com/".insteadOf "https://github.com/" | ||
git commit -m "fix: update destinations.ts" | ||
git push origin ${{ env.BRANCH_NAME }} | ||
- name: Create or Update PR | ||
if: steps.compare_files.outputs.pr_required == 'true' | ||
env: | ||
GH_TOKEN: ${{ secrets.PAT }} | ||
run: | | ||
cd dest-repo | ||
EXISTING_PR=$(gh pr list --head "$BRANCH_NAME" --json number --jq ".[0].number") | ||
if [ -z "$EXISTING_PR" ]; then | ||
# Create the PR body content in a variable | ||
PR_BODY="This PR updates the destination constants file. | ||
**Changes:** | ||
- Updated \`Destinations.ts\` with latest constants | ||
**NOTE:** This PR was automatically generated by GitHub Actions." | ||
# Create a new PR | ||
gh pr create \ | ||
--title "fix: update destination constants" \ | ||
--body "$PR_BODY" \ | ||
--label "github_actions,dependencies" | ||
else | ||
echo "PR already exists: $EXISTING_PR" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.