Skip to content

Commit 9f2b3b1

Browse files
committed
Format YAML
1 parent 05e57f9 commit 9f2b3b1

File tree

5 files changed

+85
-86
lines changed

5 files changed

+85
-86
lines changed

.github/workflows/external-message.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ jobs:
2222

2323
- name: Delete old comments
2424
env:
25-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2626
run: |
27-
# Delete previous comment if it exists
28-
previous_comment_ids=$(gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
29-
--jq '.[] | select(.body | startswith("<!-- INTEGRATION_TESTS_MANUAL -->")) | .id')
30-
echo "Previous comment IDs: $previous_comment_ids"
31-
# Iterate over each comment ID and delete the comment
32-
if [ ! -z "$previous_comment_ids" ]; then
33-
echo "$previous_comment_ids" | while read -r comment_id; do
34-
echo "Deleting comment with ID: $comment_id"
35-
gh api "repos/${{ github.repository }}/issues/comments/$comment_id" -X DELETE
36-
done
37-
fi
27+
# Delete previous comment if it exists
28+
previous_comment_ids=$(gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
29+
--jq '.[] | select(.body | startswith("<!-- INTEGRATION_TESTS_MANUAL -->")) | .id')
30+
echo "Previous comment IDs: $previous_comment_ids"
31+
# Iterate over each comment ID and delete the comment
32+
if [ ! -z "$previous_comment_ids" ]; then
33+
echo "$previous_comment_ids" | while read -r comment_id; do
34+
echo "Deleting comment with ID: $comment_id"
35+
gh api "repos/${{ github.repository }}/issues/comments/$comment_id" -X DELETE
36+
done
37+
fi
3838
3939
- name: Comment on PR
4040
env:
@@ -44,13 +44,13 @@ jobs:
4444
gh pr comment ${{ github.event.pull_request.number }} --body \
4545
"<!-- INTEGRATION_TESTS_MANUAL -->
4646
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:
47-
47+
4848
Trigger:
4949
[go/deco-tests-run/sdk-java](https://go/deco-tests-run/sdk-java)
5050
5151
Inputs:
5252
* PR number: ${{github.event.pull_request.number}}
5353
* Commit SHA: \`${{ env.COMMIT_SHA }}\`
54-
54+
5555
Checks will be approved automatically on success.
5656
"
Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
name: Integration Tests
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize]
4+
pull_request:
5+
types: [opened, synchronize]
66

7-
merge_group:
7+
merge_group:
88

99
jobs:
10-
check-token:
11-
name: Check secrets access
12-
runs-on: ubuntu-latest
13-
environment: "test-trigger-is"
14-
outputs:
15-
has_token: ${{ steps.set-token-status.outputs.has_token }}
16-
steps:
17-
- name: Check if DECO_WORKFLOW_TRIGGER_APP_ID is set
18-
id: set-token-status
19-
run: |
20-
if [ -z "${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}" ]; then
21-
echo "DECO_WORKFLOW_TRIGGER_APP_ID is empty. User has no access to secrets."
22-
echo "::set-output name=has_token::false"
23-
else
24-
echo "DECO_WORKFLOW_TRIGGER_APP_ID is set. User has access to secrets."
25-
echo "::set-output name=has_token::true"
26-
fi
10+
check-token:
11+
name: Check secrets access
12+
runs-on: ubuntu-latest
13+
environment: "test-trigger-is"
14+
outputs:
15+
has_token: ${{ steps.set-token-status.outputs.has_token }}
16+
steps:
17+
- name: Check if DECO_WORKFLOW_TRIGGER_APP_ID is set
18+
id: set-token-status
19+
run: |
20+
if [ -z "${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}" ]; then
21+
echo "DECO_WORKFLOW_TRIGGER_APP_ID is empty. User has no access to secrets."
22+
echo "::set-output name=has_token::false"
23+
else
24+
echo "DECO_WORKFLOW_TRIGGER_APP_ID is set. User has access to secrets."
25+
echo "::set-output name=has_token::true"
26+
fi
2727
28-
trigger-tests:
29-
name: Trigger Tests
30-
runs-on: ubuntu-latest
31-
needs: check-token
32-
if: github.event_name == 'pull_request' && needs.check-token.outputs.has_token == 'true'
33-
environment: "test-trigger-is"
34-
steps:
35-
- uses: actions/checkout@v3
28+
trigger-tests:
29+
name: Trigger Tests
30+
runs-on: ubuntu-latest
31+
needs: check-token
32+
if: github.event_name == 'pull_request' && needs.check-token.outputs.has_token == 'true'
33+
environment: "test-trigger-is"
34+
steps:
35+
- uses: actions/checkout@v3
3636

37-
- name: Generate GitHub App Token
38-
id: generate-token
39-
uses: actions/create-github-app-token@v1
40-
with:
41-
app-id: ${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}
42-
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }}
43-
owner: ${{ secrets.ORG_NAME }}
44-
repositories: ${{secrets.REPO_NAME}}
37+
- name: Generate GitHub App Token
38+
id: generate-token
39+
uses: actions/create-github-app-token@v1
40+
with:
41+
app-id: ${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}
42+
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }}
43+
owner: ${{ secrets.ORG_NAME }}
44+
repositories: ${{secrets.REPO_NAME}}
4545

46-
- name: Trigger Workflow in Another Repo
47-
env:
48-
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
49-
run: |
50-
gh workflow run sdk-java-isolated-pr.yml -R ${{ secrets.ORG_NAME }}/${{secrets.REPO_NAME}} \
51-
--ref main \
52-
-f pull_request_number=${{ github.event.pull_request.number }} \
53-
-f commit_sha=${{ github.event.pull_request.head.sha }}
46+
- name: Trigger Workflow in Another Repo
47+
env:
48+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
49+
run: |
50+
gh workflow run sdk-java-isolated-pr.yml -R ${{ secrets.ORG_NAME }}/${{secrets.REPO_NAME}} \
51+
--ref main \
52+
-f pull_request_number=${{ github.event.pull_request.number }} \
53+
-f commit_sha=${{ github.event.pull_request.head.sha }}
5454
55-
# Statuses and checks apply to specific commits (by hash).
56-
# Enforcement of required checks is done both at the PR level and the merge queue level.
57-
# In case of multiple commits in a single PR, the hash of the squashed commit
58-
# will not match the one for the latest (approved) commit in the PR.
59-
# We auto approve the check for the merge queue for two reasons:
60-
# * Queue times out due to duration of tests.
61-
# * Avoid running integration tests twice, since it was already run at the tip of the branch before squashing.
62-
auto-approve:
63-
if: github.event_name == 'merge_group'
64-
runs-on: ubuntu-latest
65-
steps:
66-
- name: Mark Check
67-
env:
68-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
shell: bash
70-
run: |
71-
gh api -X POST -H "Accept: application/vnd.github+json" \
72-
-H "X-GitHub-Api-Version: 2022-11-28" \
73-
/repos/${{ github.repository }}/statuses/${{ github.sha }} \
74-
-f 'state=success' \
75-
-f 'context=Integration Tests Check'
55+
# Statuses and checks apply to specific commits (by hash).
56+
# Enforcement of required checks is done both at the PR level and the merge queue level.
57+
# In case of multiple commits in a single PR, the hash of the squashed commit
58+
# will not match the one for the latest (approved) commit in the PR.
59+
# We auto approve the check for the merge queue for two reasons:
60+
# * Queue times out due to duration of tests.
61+
# * Avoid running integration tests twice, since it was already run at the tip of the branch before squashing.
62+
auto-approve:
63+
if: github.event_name == 'merge_group'
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Mark Check
67+
env:
68+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
shell: bash
70+
run: |
71+
gh api -X POST -H "Accept: application/vnd.github+json" \
72+
-H "X-GitHub-Api-Version: 2022-11-28" \
73+
/repos/${{ github.repository }}/statuses/${{ github.sha }} \
74+
-f 'state=success' \
75+
-f 'context=Integration Tests Check'

.github/workflows/message.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
TITLE: ${{ github.event.pull_request.title }}
2525
run: |
2626
TAG=$(echo "$TITLE" | sed -ne 's/\[\(.*\)\].*/\1/p')
27-
if grep -q "tag: \"\[$TAG\]\"" .codegen/changelog_config.yml; then
27+
if grep -q "tag: \"\[$TAG\]\"" .codegen/changelog_config.yml; then
2828
echo "Valid tag found: [$TAG]"
29-
else
30-
echo "Invalid or missing tag in commit message: [$TAG]"
29+
else
30+
echo "Invalid or missing tag in commit message: [$TAG]"
3131
exit 1
32-
fi
32+
fi

.github/workflows/push.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
os: [macos-latest, ubuntu-latest]
36-
java-version: [8, 11, 17, 20] # 20 is the latest version as of 2023 and 17 is the latest LTS
36+
java-version: [8, 11, 17, 20] # 20 is the latest version as of 2023 and 17 is the latest LTS
3737

3838
runs-on: ${{ matrix.os }}
3939

@@ -55,4 +55,3 @@ jobs:
5555

5656
- name: Check Unit Tests
5757
run: mvn --errors test
58-

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Release
22
on:
33
push:
44
tags:
5-
- 'v*'
5+
- "v*"
66
jobs:
77
publish:
88
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)