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

Fix and improve audit verifier action #921

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
de72bc3
added env variable initializations
0xDEnYO Jan 13, 2025
da5273f
temp - DO NOT PUSH
0xDEnYO Jan 14, 2025
810b52b
test
0xDEnYO Jan 16, 2025
fce56dc
test
0xDEnYO Jan 16, 2025
efa6549
test
0xDEnYO Jan 16, 2025
29f6105
test
0xDEnYO Jan 16, 2025
8429fe3
test
0xDEnYO Jan 16, 2025
bcac001
test
0xDEnYO Jan 16, 2025
2956313
test
0xDEnYO Jan 16, 2025
7203408
test
0xDEnYO Jan 16, 2025
9e36cd2
test
0xDEnYO Jan 16, 2025
9ed80d7
revert changes in contract
0xDEnYO Jan 16, 2025
3684bff
remove old verifier actin code
0xDEnYO Jan 16, 2025
3cbae5d
test
0xDEnYO Jan 16, 2025
11be560
test
0xDEnYO Jan 16, 2025
b22dec0
test
0xDEnYO Jan 16, 2025
7926569
remove unused workflow files
0xDEnYO Jan 16, 2025
962133e
Merge branch 'main' of github.com:lifinance/contracts into fixAuditVe…
0xDEnYO Jan 22, 2025
8b22ec6
move variable from step to job level
0xDEnYO Jan 22, 2025
5c218ea
simplified error handling and label assignments
0xDEnYO Jan 23, 2025
c993b4e
merged version control and audit checker into one workflow
0xDEnYO Jan 23, 2025
6779cfc
Merge branch 'main' of github.com:lifinance/contracts into fixAuditVe…
0xDEnYO Jan 23, 2025
f3f77c4
Update .github/workflows/versionControlAndAuditCheck.yml
0xDEnYO Jan 23, 2025
cdecd72
Update .github/workflows/versionControlAndAuditCheck.yml
0xDEnYO Jan 23, 2025
16f5467
Merge branch 'main' into fixAuditVerifierAction
0xDEnYO Jan 29, 2025
dc95b20
Update .github/workflows/versionControlAndAuditCheck.yml
0xDEnYO Jan 29, 2025
c72317c
remove unnecessary CONTINUE variable from git action
0xDEnYO Jan 30, 2025
b0e60af
Merge branch 'fixAuditVerifierAction' of github.com:lifinance/contrac…
0xDEnYO Jan 30, 2025
f86ae29
Merge branch 'main' of github.com:lifinance/contracts into fixAuditVe…
0xDEnYO Jan 30, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/ensureSCCoreDevApproval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
env:
GH_PAT: ${{ secrets.GIT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONTINUE: false # makes sure that variable is correctly initialized in all cases
0xDEnYO marked this conversation as resolved.
Show resolved Hide resolved
0xDEnYO marked this conversation as resolved.
Show resolved Hide resolved
0xDEnYO marked this conversation as resolved.
Show resolved Hide resolved
run: |

##### unset the default git token (does not have sufficient rights to get team members)
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/protectAuditLabels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
jobs:
protect_audit_labels:
runs-on: ubuntu-latest
env:
CONTINUE: false # makes sure that variable is correctly initialized in all cases
mirooon marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/protectSecurityRelevantCode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
protect-critical-code:
if: ${{ github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
env:
CONTINUE: false # makes sure that variable is correctly initialized in all cases
permissions:
pull-requests: write
steps:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/verifyAudit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GIT_ACTIONS_BOT_PAT_CLASSIC }}
AUDIT_LOG_PATH: 'audit/auditLog.json'
PR_NUMBER: ${{ github.event.pull_request.number }}
CONTINUE: false # makes sure that variable is correctly initialized in all cases

permissions:
pull-requests: write
Expand Down Expand Up @@ -67,8 +68,8 @@ jobs:
echo -e "\033[31mProtected contracts found in this PR.\033[0m"
echo "PROTECTED_CONTRACTS: $PROTECTED_CONTRACTS"
echo "AUDIT_REQUIRED=true" >> "$GITHUB_ENV"
echo "$AUDIT_REQUIRED" > audit_required.txt
echo -e "$PROTECTED_CONTRACTS" > protected_contracts.txt
echo "CONTINUE=true" >> "$GITHUB_ENV"
fi

- name: Assign, update, and verify labels based on check outcome
Expand Down Expand Up @@ -159,7 +160,7 @@ jobs:
- name: Check Audit Log
continue-on-error: true
id: check-audit-log
if: env.AUDIT_REQUIRED == 'true'
if: always() && env.CONTINUE == 'true' # always() ensures that validation is always executed, even if env variable is not set
run: |

echo "This step will make sure that an audit is logged for each contract modified/added by this PR."
Expand Down Expand Up @@ -381,7 +382,7 @@ jobs:
echo "Assigning label 'AuditCompleted' next"

- name: Assign label "AuditCompleted" if all checks passed
if: ${{ env.AUDIT_REQUIRED == 'true' && env.CONTINUE == 'true' }}
if: ${{ always() && env.AUDIT_REQUIRED == 'true' && env.CONTINUE == 'true' }}
uses: actions-ecosystem/action-add-labels@v1
id: assign_label
with:
Expand All @@ -392,14 +393,14 @@ jobs:
- name: Remove label "AuditCompleted" in case check was not successful but label was assigned in earlier checks
continue-on-error: true # This ensures the step will execute even if the job has a failed status.
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ env.AUDIT_COMPLETED_ASSIGNED && (env.CONTINUE == 'false' || (env.CONTINUE == 'true' && env.AUDIT_REQUIRED == 'false'))}}
if: ${{ always() && env.AUDIT_COMPLETED_ASSIGNED && (env.CONTINUE == 'false' || (env.CONTINUE == 'true' && env.AUDIT_REQUIRED == 'false'))}}
with:
github_token: ${{ secrets.GIT_ACTIONS_BOT_PAT_CLASSIC }} # we use the token of the lifi-action-bot so the label protection check will pass
labels: 'AuditCompleted'
number: ${{ env.PR_NUMBER }}

- name: Fail the git action if any critical step failed
if: env.CONTINUE == 'false' # This step runs only if a failure was recorded
if: always() && env.CONTINUE == 'false' # This step runs only if a failure was recorded
run: |

echo -e "\033[31mError: One or more critical steps failed. Failing the job.\033[0m"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/versionCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
# will only run once the PR is in "Ready for Review" state
if: ${{ github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
env:
CONTINUE: false # makes sure that variable is correctly initialized in all cases
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
jobs:
protect-security-system:
runs-on: ubuntu-latest
env:
CONTINUE: false # makes sure that variable is correctly initialized in all cases
permissions:
pull-requests: write
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows_deactivated/ensureSCCoreDevApproval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
core-dev-approval:
if: ${{ github.event.pull_request.draft == false }} # will only run once the PR is in "Ready for Review" state
runs-on: ubuntu-latest
env:
CONTINUE: false # makes sure that variable is correctly initialized in all cases
0xDEnYO marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Get smart-contract-core Team Members
env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows_deactivated/protectAuditFolder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
jobs:
protect-audit-folder:
runs-on: ubuntu-latest
env:
CONTINUE: false # makes sure that variable is correctly initialized in all cases

steps:
- name: Checkout code
Expand Down
Loading