-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into remove-uncessary-get
- Loading branch information
Showing
181 changed files
with
7,540 additions
and
1,370 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0c86ea6dbd9a730c24ff0d4e509603e476955ac5 | ||
d25296d2f4aa7bd6195c816fdf82e0f960f775da |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: PR Comment | ||
|
||
# WARNING: | ||
# THIS WORKFLOW ALWAYS RUNS FOR EXTERNAL CONTRIBUTORS WITHOUT ANY APPROVAL. | ||
# THIS WORKFLOW RUNS FROM MAIN BRANCH, NOT FROM THE PR BRANCH. | ||
# DO NOT PULL THE PR OR EXECUTE ANY CODE FROM THE PR. | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, reopened, synchronize] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
comment-on-pr: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Delete old comments | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
# Delete previous comment if it exists | ||
previous_comment_ids=$(gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \ | ||
--jq '.[] | select(.body | startswith("<!-- INTEGRATION_TESTS_MANUAL -->")) | .id') | ||
echo "Previous comment IDs: $previous_comment_ids" | ||
# Iterate over each comment ID and delete the comment | ||
if [ ! -z "$previous_comment_ids" ]; then | ||
echo "$previous_comment_ids" | while read -r comment_id; do | ||
echo "Deleting comment with ID: $comment_id" | ||
gh api "repos/${{ github.repository }}/issues/comments/$comment_id" -X DELETE | ||
done | ||
fi | ||
- name: Comment on PR | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | ||
run: | | ||
gh pr comment ${{ github.event.pull_request.number }} --body \ | ||
"<!-- INTEGRATION_TESTS_MANUAL --> | ||
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: | ||
Trigger: | ||
[go/deco-tests-run/cli](https://go/deco-tests-run/cli) | ||
Inputs: | ||
* PR number: ${{github.event.pull_request.number}} | ||
* Commit SHA: \`${{ env.COMMIT_SHA }}\` | ||
Checks will be approved automatically on success. | ||
" |
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: integration | ||
|
||
on: | ||
|
||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
merge_group: | ||
|
||
|
||
jobs: | ||
check-token: | ||
runs-on: ubuntu-latest | ||
environment: "test-trigger-is" | ||
outputs: | ||
has_token: ${{ steps.set-token-status.outputs.has_token }} | ||
steps: | ||
- name: Check if DECO_WORKFLOW_TRIGGER_APP_ID is set | ||
id: set-token-status | ||
run: | | ||
if [ -z "${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}" ]; then | ||
echo "DECO_WORKFLOW_TRIGGER_APP_ID is empty. User has no access to secrets." | ||
echo "::set-output name=has_token::false" | ||
else | ||
echo "DECO_WORKFLOW_TRIGGER_APP_ID is set. User has access to secrets." | ||
echo "::set-output name=has_token::true" | ||
fi | ||
trigger-tests: | ||
runs-on: ubuntu-latest | ||
needs: check-token | ||
if: github.event_name == 'pull_request' && needs.check-token.outputs.has_token == 'true' | ||
environment: "test-trigger-is" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Generate GitHub App Token | ||
id: generate-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }} | ||
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }} | ||
owner: ${{ secrets.ORG_NAME }} | ||
repositories: ${{secrets.REPO_NAME}} | ||
|
||
- name: Trigger Workflow in Another Repo | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
run: | | ||
gh workflow run cli-isolated-pr.yml -R ${{ secrets.ORG_NAME }}/${{secrets.REPO_NAME}} \ | ||
--ref main \ | ||
-f pull_request_number=${{ github.event.pull_request.number }} \ | ||
-f commit_sha=${{ github.event.pull_request.head.sha }} | ||
# Statuses and checks apply to specific commits (by hash). | ||
# Enforcement of required checks is done both at the PR level and the merge queue level. | ||
# In case of multiple commits in a single PR, the hash of the squashed commit | ||
# will not match the one for the latest (approved) commit in the PR. | ||
# We auto approve the check for the merge queue for two reasons: | ||
# * Queue times out due to duration of tests. | ||
# * Avoid running integration tests twice, since it was already run at the tip of the branch before squashing. | ||
auto-approve: | ||
if: github.event_name == 'merge_group' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark Check | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
shell: bash | ||
run: | | ||
gh api -X POST -H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | ||
-f 'state=success' \ | ||
-f 'context=Integration Tests Check' |
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
Oops, something went wrong.