Skip to content

Commit b444e78

Browse files
authored
Clean up lint errors in workflows (#191987)
This PR resolves shellcheck and syntax issues flagged by `actionlint` across GitHub Actions workflows. I've been using `actionlint` to check workflows for errors. This brings it clean. Fixing others in - no-main-prs: #191973 - scheduled-localization-update: #191991 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 3238b12 commit b444e78

6 files changed

Lines changed: 49 additions & 45 deletions

File tree

‎.github/workflows/content-aware-hash.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
# test notice annotation for retrival from api
2626
echo "::notice ::{\"engine_content_hash\": \"${engine_content_hash}\"}"
2727
# test summary writing
28-
echo "{\"engine_content_hash\": \"${engine_content_hash}\"" >> $GITHUB_STEP_SUMMARY
28+
echo "{\"engine_content_hash\": \"${engine_content_hash}\"" >> "$GITHUB_STEP_SUMMARY"

‎.github/workflows/cut-release-branch.yml‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
run: |
2727
# Use the GitHub CLI to check team membership
2828
# Returns 204 if member, 404 if not
29-
if gh api orgs/flutter/teams/flutter-release-eng/memberships/$ACTOR --silent; then
30-
echo "is_member=true" >> $GITHUB_OUTPUT
29+
if gh api "orgs/flutter/teams/flutter-release-eng/memberships/$ACTOR" --silent; then
30+
echo "is_member=true" >> "$GITHUB_OUTPUT"
3131
else
3232
echo "::error::User $ACTOR is not a member of flutter-release-eng."
3333
exit 1
@@ -71,11 +71,11 @@ jobs:
7171
env:
7272
VERSION: ${{ inputs.version }}
7373
run: |
74-
echo "BRANCH_NAME=flutter-$VERSION-candidate.0" >> $GITHUB_ENV
74+
echo "BRANCH_NAME=flutter-$VERSION-candidate.0" >> "$GITHUB_ENV"
7575
7676
- name: Check if branch already exists
7777
run: |
78-
if git ls-remote --exit-code --heads origin $BRANCH_NAME; then
78+
if git ls-remote --exit-code --heads origin "$BRANCH_NAME"; then
7979
echo "Error: Branch $BRANCH_NAME already exists on remote."
8080
exit 1
8181
fi
@@ -85,7 +85,7 @@ jobs:
8585
- name: Create Branch and Version File
8686
run: |
8787
# Create and switch to the new branch locally
88-
git checkout -b $BRANCH_NAME
88+
git checkout -b "$BRANCH_NAME"
8989
9090
# Create the version file
9191
mkdir -p bin/internal/
@@ -97,9 +97,11 @@ jobs:
9797
9898
- name: Push new branch
9999
run: |
100-
git push origin $BRANCH_NAME
101-
echo "## Release Branch \`$BRANCH_NAME\` Cut Successfully" >> $GITHUB_STEP_SUMMARY
102-
echo "" >> $GITHUB_STEP_SUMMARY
103-
echo "🔗 **View Branch** https://github.com/$GITHUB_REPOSITORY/tree/$BRANCH_NAME" >> $GITHUB_STEP_SUMMARY
100+
git push origin "$BRANCH_NAME"
101+
{
102+
echo "## Release Branch \`$BRANCH_NAME\` Cut Successfully"
103+
echo ""
104+
echo "🔗 **View Branch** https://github.com/$GITHUB_REPOSITORY/tree/$BRANCH_NAME"
105+
} >> "$GITHUB_STEP_SUMMARY"
104106
env:
105107
GH_TOKEN: ${{ secrets.FLUTTERACTIONSBOT_CP_TOKEN }}

‎.github/workflows/easy-cp.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
steps:
4343
- name: Remove Label and Leave Comment
4444
run: |
45-
gh issue edit $ISSUE_NUMBER -R flutter/flutter --remove-label "$LABEL_NAME"
46-
gh issue comment $ISSUE_NUMBER -R flutter/flutter -b "Cherry-pick labels should only be applied to merged pull requests."
45+
gh issue edit "$ISSUE_NUMBER" -R flutter/flutter --remove-label "$LABEL_NAME"
46+
gh issue comment "$ISSUE_NUMBER" -R flutter/flutter -b "Cherry-pick labels should only be applied to merged pull requests."
4747
env:
4848
GH_TOKEN: ${{ secrets.FLUTTERACTIONSBOT_CP_TOKEN }}
4949
LABEL_NAME: ${{ github.event.label.name }}
@@ -61,7 +61,7 @@ jobs:
6161
id: get-channel
6262
env:
6363
LABEL_NAME: ${{ github.event.label.name }}
64-
run: echo "channel=$(echo $LABEL_NAME | cut -d ':' -f 2 | xargs)" >> "$GITHUB_OUTPUT"
64+
run: echo "channel=$(echo "$LABEL_NAME" | cut -d ':' -f 2 | xargs)" >> "$GITHUB_OUTPUT"
6565

6666
- name: Export Release Candidate Branch
6767
id: get-branch

‎.github/workflows/merge-changelog.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
run: |
7474
gh pr create \
7575
--base master \
76-
--head flutteractionsbot:$PR_BRANCH_NAME \
76+
--head "flutteractionsbot:$PR_BRANCH_NAME" \
7777
--repo flutter/flutter \
7878
--title "Sync CHANGELOG.md from stable" \
7979
--body "This PR automates the synchronization of \`CHANGELOG.md\` from the \`stable\` branch to the \`master\` branch." \

‎.github/workflows/roll-dart-dependencies.yml‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
- name: Fetch upstream
3636
run: |
3737
git remote add upstream https://github.com/flutter/flutter.git
38-
git fetch upstream $REF_NAME
38+
git fetch upstream "$REF_NAME"
3939
4040
BRANCH_NAME="sync-dart-$DART_HASH"
41-
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
41+
echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_ENV"
4242
43-
git checkout -b "$BRANCH_NAME" upstream/$REF_NAME
43+
git checkout -b "$BRANCH_NAME" "upstream/$REF_NAME"
4444
env:
4545
GH_TOKEN: ${{ secrets.FLUTTERACTIONSBOT_CP_TOKEN }}
4646
REF_NAME: ${{ github.ref_name }}
@@ -54,9 +54,7 @@ jobs:
5454
echo "Fetching DEPS from $URL"
5555
5656
# Googlesource returns base64 encoded text when format=TEXT is used
57-
RESPONSE=$(curl -s -f "$URL")
58-
59-
if [ $? -ne 0 ]; then
57+
if ! RESPONSE=$(curl -s -f "$URL"); then
6058
echo "::error::Failed to download DEPS file. Please verify the Dart hash: $DART_HASH"
6159
exit 1
6260
fi
@@ -99,11 +97,11 @@ jobs:
9997
run: |
10098
# Check if the root DEPS file has changed
10199
if git diff --exit-code DEPS; then
102-
echo "changed=false" >> $GITHUB_OUTPUT
103-
echo "## ✅ Dart version already up to date" >> $GITHUB_STEP_SUMMARY
104-
echo "The DEPS file is already up to date with Dart hash \`$DART_HASH\`." >> $GITHUB_STEP_SUMMARY
100+
echo "changed=false" >> "$GITHUB_OUTPUT"
101+
echo "## ✅ Dart version already up to date" >> "$GITHUB_STEP_SUMMARY"
102+
echo "The DEPS file is already up to date with Dart hash \`$DART_HASH\`." >> "$GITHUB_STEP_SUMMARY"
105103
else
106-
echo "changed=true" >> $GITHUB_OUTPUT
104+
echo "changed=true" >> "$GITHUB_OUTPUT"
107105
fi
108106
109107
- name: Create PR if Changed
@@ -118,14 +116,16 @@ jobs:
118116
--title "[$REF_NAME] Update Flutter DEPS to Dart $DART_HASH" \
119117
--body "This PR updates the transitive dependencies in the engine \`DEPS\` file based on Dart SDK hash \`$DART_HASH\`." \
120118
--repo flutter/flutter \
121-
--base $REF_NAME \
122-
--head flutteractionsbot:$BRANCH_NAME)
119+
--base "$REF_NAME" \
120+
--head "flutteractionsbot:$BRANCH_NAME")
123121
124122
# Nice big PR Success Summary
125-
echo "## 🚀 PR Created Successfully" >> $GITHUB_STEP_SUMMARY
126-
echo "Updated dart dependencies to \`$DART_HASH\`." >> $GITHUB_STEP_SUMMARY
127-
echo "" >> $GITHUB_STEP_SUMMARY
128-
echo "🔗 **View Pull Request:** $PR_URL" >> $GITHUB_STEP_SUMMARY
123+
{
124+
echo "## 🚀 PR Created Successfully"
125+
echo "Updated dart dependencies to \`$DART_HASH\`."
126+
echo ""
127+
echo "🔗 **View Pull Request:** $PR_URL"
128+
} >> "$GITHUB_STEP_SUMMARY"
129129
env:
130130
GH_TOKEN: ${{ secrets.FLUTTERACTIONSBOT_CP_TOKEN }}
131131
DART_HASH: ${{ inputs.dart_hash }}

‎.github/workflows/sync-engine-version.yml‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
- name: Fetch upstream
3131
run: |
3232
git remote add upstream https://github.com/flutter/flutter.git
33-
git fetch upstream $REF_NAME
33+
git fetch upstream "$REF_NAME"
3434
3535
BRANCH_NAME="update-engine-$(date +%s)"
36-
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
36+
echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_ENV"
3737
38-
git checkout -b "$BRANCH_NAME" upstream/$REF_NAME
38+
git checkout -b "$BRANCH_NAME" "upstream/$REF_NAME"
3939
env:
4040
GH_TOKEN: ${{ secrets.FLUTTERACTIONSBOT_CP_TOKEN }}
4141
REF_NAME: ${{ github.ref_name }}
@@ -49,13 +49,13 @@ jobs:
4949
else
5050
OLD_HASH="None (New File)"
5151
fi
52-
echo "OLD_HASH=$OLD_HASH" >> $GITHUB_ENV
52+
echo "OLD_HASH=$OLD_HASH" >> "$GITHUB_ENV"
5353
5454
chmod +x bin/internal/last_engine_commit.sh
5555
NEW_HASH=$(./bin/internal/last_engine_commit.sh)
5656
5757
echo "$NEW_HASH" > bin/internal/engine.version
58-
echo "ENGINE_HASH=$NEW_HASH" >> $GITHUB_ENV
58+
echo "ENGINE_HASH=$NEW_HASH" >> "$GITHUB_ENV"
5959
6060
- name: Check for Changes
6161
id: git-check
@@ -64,13 +64,13 @@ jobs:
6464
git add -f bin/internal/engine.version
6565
6666
if git diff --cached --exit-code bin/internal/engine.version; then
67-
echo "changed=false" >> $GITHUB_OUTPUT
67+
echo "changed=false" >> "$GITHUB_OUTPUT"
6868
6969
# Nice big No-Op Summary
70-
echo "## ✅ Engine version already up to date" >> $GITHUB_STEP_SUMMARY
71-
echo "The engine is already at hash \`$ENGINE_HASH\`. No PR was created." >> $GITHUB_STEP_SUMMARY
70+
echo "## ✅ Engine version already up to date" >> "$GITHUB_STEP_SUMMARY"
71+
echo "The engine is already at hash \`$ENGINE_HASH\`. No PR was created." >> "$GITHUB_STEP_SUMMARY"
7272
else
73-
echo "changed=true" >> $GITHUB_OUTPUT
73+
echo "changed=true" >> "$GITHUB_OUTPUT"
7474
fi
7575
7676
- name: Create PR if Changed
@@ -85,14 +85,16 @@ jobs:
8585
--title "[$REF_NAME] Sync engine.version to $ENGINE_HASH" \
8686
--body "Updates the engine.version file from \`$OLD_HASH\` to \`$ENGINE_HASH\`." \
8787
--repo flutter/flutter \
88-
--base $REF_NAME \
89-
--head flutteractionsbot:$BRANCH_NAME)
88+
--base "$REF_NAME" \
89+
--head "flutteractionsbot:$BRANCH_NAME")
9090
9191
# Nice big PR Success Summary
92-
echo "## 🚀 PR Created Successfully" >> $GITHUB_STEP_SUMMARY
93-
echo "Updated engine version from \`$OLD_HASH\` to \`$ENGINE_HASH\`." >> $GITHUB_STEP_SUMMARY
94-
echo "" >> $GITHUB_STEP_SUMMARY
95-
echo "🔗 **View Pull Request:** $PR_URL" >> $GITHUB_STEP_SUMMARY
92+
{
93+
echo "## 🚀 PR Created Successfully"
94+
echo "Updated engine version from \`$OLD_HASH\` to \`$ENGINE_HASH\`."
95+
echo ""
96+
echo "🔗 **View Pull Request:** $PR_URL"
97+
} >> "$GITHUB_STEP_SUMMARY"
9698
env:
9799
GH_TOKEN: ${{ secrets.FLUTTERACTIONSBOT_CP_TOKEN }}
98100
REF_NAME: ${{ github.ref_name }}

0 commit comments

Comments
 (0)