Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed drive action #355

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ jobs:
USER_GID=1000

- name: Save PR ID
if: github.event_name == 'pull_request'
env:
PR_ID: ${{ github.event.number }}
run: |
mkdir -p ./pr
echo $PR_ID > ./pr/pr_id

Comment on lines +87 to 93
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Quote the PR_ID variable in the shell command.

The shell command should quote the PR_ID variable to prevent word splitting and ensure proper handling of special characters.

Apply this diff to fix the shell command:

        run: |
          mkdir -p ./pr
-          echo $PR_ID > ./pr/pr_id
+          echo "$PR_ID" > ./pr/pr_id
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if: github.event_name == 'pull_request'
env:
PR_ID: ${{ github.event.number }}
run: |
mkdir -p ./pr
echo $PR_ID > ./pr/pr_id
if: github.event_name == 'pull_request'
env:
PR_ID: ${{ github.event.number }}
run: |
mkdir -p ./pr
echo "$PR_ID" > ./pr/pr_id
🧰 Tools
🪛 actionlint

90-90: shellcheck reported issue in this script: SC2086:info:2:6: Double quote to prevent globbing and word splitting

(shellcheck)

- name: Upload PR ID
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: pr_id
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/drive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
echo "AGENT_VERSION=${AGENT_VERSION}"
echo "COMPOSE_FILE=${COMPOSE_FILE}"
- name: 'Download artifact (PR ID)'
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
Expand All @@ -46,10 +47,12 @@ jobs:
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_id.zip`, Buffer.from(download.data));

- name: 'Unzip artifact (PR ID)'
if: github.event_name == 'pull_request'
run: |
unzip pr_id.zip

- name: Check PR ID
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
Expand All @@ -71,6 +74,7 @@ jobs:
run: docker compose down -v
# add rendered JSON as comment to the pull request
- name: Add simulation results as comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading