Skip to content

Commit

Permalink
respond to AI comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Nov 27, 2024
1 parent 7d5a4b4 commit c05fca0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/compare-layouts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ jobs:
|| github.event.workflow_run.head_branch
}}
run: |
gh pr view --repo "${PR_TARGET_REPO}" "${PR_BRANCH}" \
--json 'number' --jq '"number=\(.number)"' \
>> "${GITHUB_OUTPUT}"
pr_number=$(gh pr view --repo "${PR_TARGET_REPO}" "${PR_BRANCH}" \
--json 'number' --jq '.number')
if [ -z "$pr_number" ]; then
echo "Error: PR number not found for branch '${PR_BRANCH}' in repository '${PR_TARGET_REPO}'" >&2
exit 1
fi
echo "number=$pr_number" >> "${GITHUB_OUTPUT}"
- name: Set message
id: set-message
env:
Expand Down Expand Up @@ -117,7 +121,7 @@ jobs:
key: ${{ needs.setup.outputs.cache-key }}
- name: Add Foundry to PATH
if: ${{ github.event.workflow_run.conclusion == 'success' }}
run: echo "${{ needs.setup.outputs.installation-dir }}" >> $GITHUB_PATH
run: echo "${{ needs.setup.outputs.installation-dir }}" >> "$GITHUB_PATH"
- name: Fetch the deployed layouts
if: ${{ github.event.workflow_run.conclusion == 'success' }}
run: |
Expand Down Expand Up @@ -163,7 +167,7 @@ jobs:
run: unzip storage-layouts.zip
- name: Set up Node.js
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Clear npm cache
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/forge-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
path: ${{ needs.setup.outputs.installation-dir }}
key: ${{ needs.setup.outputs.cache-key }}
- name: Add Foundry to PATH
run: echo "${{ needs.setup.outputs.installation-dir }}" >> $GITHUB_PATH
run: echo "${{ needs.setup.outputs.installation-dir }}" >> "$GITHUB_PATH"
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand All @@ -64,7 +64,7 @@ jobs:
path: ${{ needs.build.outputs.installation-dir }}
key: ${{ needs.build.outputs.cache-key }}
- name: Add Foundry to PATH
run: echo "${{ needs.build.outputs.installation-dir }}" >> $GITHUB_PATH
run: echo "${{ needs.build.outputs.installation-dir }}" >> "$GITHUB_PATH"
- name: Checkout repository
uses: actions/checkout@v4
- name: Restore build artifacts
Expand All @@ -91,7 +91,7 @@ jobs:
path: ${{ needs.build.outputs.installation-dir }}
key: ${{ needs.build.outputs.cache-key }}
- name: Add Foundry to PATH
run: echo "${{ needs.build.outputs.installation-dir }}" >> $GITHUB_PATH
run: echo "${{ needs.build.outputs.installation-dir }}" >> "$GITHUB_PATH"
- name: Checkout repository
uses: actions/checkout@v4
- name: Restore build artifacts
Expand All @@ -116,7 +116,7 @@ jobs:
path: ${{ needs.build.outputs.installation-dir }}
key: ${{ needs.build.outputs.cache-key }}
- name: Add Foundry to PATH
run: echo "${{ needs.build.outputs.installation-dir }}" >> $GITHUB_PATH
run: echo "${{ needs.build.outputs.installation-dir }}" >> "$GITHUB_PATH"
- name: Checkout base branch or previous commit
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
- name: Copy back base branch layout file
run: cp /tmp/ExocoreGateway.base.json ./ExocoreGateway.base.json
- name: Zip storage layout files
run: zip storage-layouts.zip *.compiled.json ExocoreGateway.base.json
run: zip "storage-layouts.zip" "./*.compiled.json" "./ExocoreGateway.base.json"
- name: Upload storage layout files as an artifact
uses: actions/upload-artifact@v4
with:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/status-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ jobs:
|| github.event.workflow_run.head_branch
}}
run: |
gh pr view --repo "${PR_TARGET_REPO}" "${PR_BRANCH}" \
--json 'number' --jq '"number=\(.number)"' \
>> "${GITHUB_OUTPUT}"
pr_number=$(gh pr view --repo "${PR_TARGET_REPO}" "${PR_BRANCH}" \
--json 'number' --jq '.number')
if [ -z "$pr_number" ]; then
echo "Error: PR number not found for branch '${PR_BRANCH}' in repository '${PR_TARGET_REPO}'" >&2
exit 1
fi
echo "number=$pr_number" >> "${GITHUB_OUTPUT}"
# Construct the message
- name: Set message
id: set-message
Expand Down Expand Up @@ -77,4 +81,4 @@ jobs:
header: ${{ github.event.workflow_run.name }}
hide_details: true
number: ${{ steps.pr-context.outputs.number }}
message: ${{ steps.set-message.outputs.message }}
message: ${{ steps.set-message.outputs.message }}
2 changes: 1 addition & 1 deletion script/compareLayouts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const { getStorageUpgradeReport } = require('@openzeppelin/upgrades-core/dist/storage');
const { getStorageUpgradeReport } = require('@openzeppelin/upgrades-core');

// Mapping of deployed and compiled file names
const fileMappings = [
Expand Down

0 comments on commit c05fca0

Please sign in to comment.