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

Git action test [AllBridgeFacet v3.0.1] [@coderabbit ignore] #731

Closed
wants to merge 423 commits into from
Closed
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
423 commits
Select commit Hold shift + click to select a range
4a0c6dd
test
0xDEnYO Aug 6, 2024
a2dd04d
test
0xDEnYO Aug 6, 2024
7624e6d
test
0xDEnYO Aug 6, 2024
9d9f06c
test
0xDEnYO Aug 6, 2024
2048659
test
0xDEnYO Aug 6, 2024
71d6c4f
test
0xDEnYO Aug 6, 2024
8b13a28
test
0xDEnYO Aug 6, 2024
2ff84d9
test
0xDEnYO Aug 6, 2024
bbdbf0b
test
0xDEnYO Aug 6, 2024
c20e711
test
0xDEnYO Aug 6, 2024
995f56f
test
0xDEnYO Aug 6, 2024
b2d5795
test
0xDEnYO Aug 6, 2024
1a13bf8
test
0xDEnYO Aug 6, 2024
1867566
test
0xDEnYO Aug 6, 2024
086f83b
test
0xDEnYO Aug 6, 2024
6c75fab
test
0xDEnYO Aug 6, 2024
4cc2ccb
test
0xDEnYO Aug 6, 2024
a9058f0
test
0xDEnYO Aug 6, 2024
460051c
test
0xDEnYO Aug 6, 2024
3308b13
test
0xDEnYO Aug 6, 2024
974b124
test
0xDEnYO Aug 6, 2024
d678b27
test
0xDEnYO Aug 6, 2024
57eb643
test
0xDEnYO Aug 6, 2024
124edf4
test
0xDEnYO Aug 6, 2024
0536da3
test
0xDEnYO Aug 6, 2024
6a22711
test
0xDEnYO Aug 6, 2024
c5e72a3
test
0xDEnYO Aug 6, 2024
dc3e20d
test
0xDEnYO Aug 6, 2024
3630190
test
0xDEnYO Aug 6, 2024
2aace13
test
0xDEnYO Aug 6, 2024
4dce6be
test
0xDEnYO Aug 6, 2024
9d901c8
test
0xDEnYO Aug 6, 2024
1efe608
test
0xDEnYO Aug 6, 2024
268f915
test
0xDEnYO Aug 6, 2024
ef418d2
test
0xDEnYO Aug 6, 2024
1fa4edd
test
0xDEnYO Aug 6, 2024
c4eb4eb
test
0xDEnYO Aug 6, 2024
4fffb6b
test
0xDEnYO Aug 6, 2024
5d8c299
test
0xDEnYO Aug 6, 2024
23d8b54
test
0xDEnYO Aug 6, 2024
59f50fe
test
0xDEnYO Aug 6, 2024
1cd6a8a
test
0xDEnYO Aug 6, 2024
c6a0333
test
0xDEnYO Aug 6, 2024
1190a6a
test
0xDEnYO Aug 6, 2024
3385b5f
test
0xDEnYO Aug 13, 2024
dffb130
test
0xDEnYO Aug 13, 2024
a5a7134
test
0xDEnYO Aug 13, 2024
2f3d880
test
0xDEnYO Aug 13, 2024
248db66
test
0xDEnYO Aug 13, 2024
3c16f1a
test
0xDEnYO Aug 13, 2024
58248db
test
0xDEnYO Aug 13, 2024
e556b86
test
0xDEnYO Aug 13, 2024
cc8ef9f
test
0xDEnYO Aug 13, 2024
2a1b2cb
test
0xDEnYO Aug 13, 2024
616cecf
test
0xDEnYO Aug 13, 2024
68ab87e
test
0xDEnYO Aug 13, 2024
80149b4
test
0xDEnYO Aug 13, 2024
3391730
test
0xDEnYO Aug 13, 2024
622f637
test
0xDEnYO Aug 13, 2024
1218b8e
test
0xDEnYO Aug 13, 2024
0c543c3
test
0xDEnYO Aug 13, 2024
d92e123
test
0xDEnYO Aug 13, 2024
647ff42
test
0xDEnYO Aug 13, 2024
f717baa
test
0xDEnYO Aug 13, 2024
2c82a53
test
0xDEnYO Aug 13, 2024
b8df10d
test
0xDEnYO Aug 13, 2024
7a483bd
test
0xDEnYO Aug 13, 2024
b5678a9
test
0xDEnYO Aug 13, 2024
d678ac1
test
0xDEnYO Aug 13, 2024
2d42187
test
0xDEnYO Aug 13, 2024
6e6ccb5
test
0xDEnYO Aug 13, 2024
4eb0dac
test
0xDEnYO Aug 13, 2024
9391b20
test
0xDEnYO Aug 13, 2024
ec807e9
test
0xDEnYO Aug 13, 2024
60f6f3b
test
0xDEnYO Aug 13, 2024
dec8f9c
test
0xDEnYO Aug 13, 2024
06960a8
test
0xDEnYO Aug 13, 2024
2bc2b35
test
0xDEnYO Aug 13, 2024
f9fb402
test
0xDEnYO Aug 13, 2024
3a3ad31
test
0xDEnYO Aug 13, 2024
2c1ab08
test
0xDEnYO Aug 13, 2024
111ce42
test
0xDEnYO Aug 13, 2024
400203c
test
0xDEnYO Aug 13, 2024
07ab58d
test
0xDEnYO Aug 13, 2024
b7ec69a
test
0xDEnYO Aug 13, 2024
0cd2dbc
test
0xDEnYO Aug 13, 2024
3b1cf7a
test
0xDEnYO Aug 13, 2024
fb32ea6
test
0xDEnYO Aug 13, 2024
ade2d71
test
0xDEnYO Aug 13, 2024
f15c207
test
0xDEnYO Aug 13, 2024
b5f3855
test
0xDEnYO Aug 13, 2024
1c61f1e
test
0xDEnYO Aug 13, 2024
f8890a5
test
0xDEnYO Aug 13, 2024
4e0e2ad
test
0xDEnYO Aug 14, 2024
722d9e0
test
0xDEnYO Aug 14, 2024
a77a99b
test
0xDEnYO Aug 14, 2024
7940ae7
test
0xDEnYO Aug 14, 2024
1b3d948
test
0xDEnYO Aug 14, 2024
fd2a4f3
test
0xDEnYO Aug 14, 2024
d53d020
test
0xDEnYO Aug 14, 2024
6290880
test
0xDEnYO Aug 14, 2024
6b303c8
test
0xDEnYO Aug 14, 2024
50d95f6
test
0xDEnYO Aug 22, 2024
3cafe79
test
0xDEnYO Aug 22, 2024
33d9828
Merge branch 'main' of github.com:lifinance/contracts into gitActionTest
0xDEnYO Aug 22, 2024
743e7f9
test
0xDEnYO Aug 22, 2024
1b7eb28
test
0xDEnYO Aug 22, 2024
27f3d93
test
0xDEnYO Aug 22, 2024
92e0cee
test
0xDEnYO Aug 22, 2024
9f1f3ab
test
0xDEnYO Aug 22, 2024
b197247
test
0xDEnYO Aug 22, 2024
7696919
test
0xDEnYO Aug 23, 2024
8b1394b
test
0xDEnYO Aug 23, 2024
b722853
test
0xDEnYO Aug 23, 2024
7cb2010
test
0xDEnYO Aug 23, 2024
63b1ba4
test
0xDEnYO Aug 23, 2024
4a695af
test
0xDEnYO Aug 23, 2024
ab5f9aa
test
0xDEnYO Aug 23, 2024
50f5ee8
test
0xDEnYO Aug 23, 2024
a001b97
test
0xDEnYO Aug 23, 2024
ee5d4b4
test
0xDEnYO Aug 23, 2024
5010a9c
test
0xDEnYO Aug 23, 2024
4862328
test
0xDEnYO Aug 23, 2024
f545ac6
test
0xDEnYO Aug 23, 2024
d569242
test
0xDEnYO Aug 23, 2024
4d92b02
test
0xDEnYO Aug 23, 2024
09ca892
test
0xDEnYO Aug 23, 2024
f13d095
test
0xDEnYO Aug 23, 2024
9f4802f
test
0xDEnYO Aug 23, 2024
fb9a54f
test
0xDEnYO Aug 23, 2024
e3d145f
test
0xDEnYO Aug 23, 2024
3c44e3b
test
0xDEnYO Aug 23, 2024
910b36b
test
0xDEnYO Aug 23, 2024
77cae07
test
0xDEnYO Aug 23, 2024
d354166
test
0xDEnYO Aug 23, 2024
c9eb4ae
test
0xDEnYO Aug 23, 2024
777e025
test
0xDEnYO Aug 23, 2024
560755b
test
0xDEnYO Aug 23, 2024
16317df
test
0xDEnYO Aug 23, 2024
fcb92c2
test
0xDEnYO Aug 23, 2024
47e22fa
test
0xDEnYO Aug 23, 2024
b33691f
test
0xDEnYO Aug 23, 2024
e90e67e
test
0xDEnYO Aug 23, 2024
73b53c2
test
0xDEnYO Aug 23, 2024
754ae19
test
0xDEnYO Aug 23, 2024
a0d9f8f
test
0xDEnYO Aug 23, 2024
30608e4
test
0xDEnYO Aug 23, 2024
67377c9
test
0xDEnYO Aug 23, 2024
0f42fa3
test
0xDEnYO Aug 23, 2024
3c33764
test
0xDEnYO Aug 23, 2024
2219120
test
0xDEnYO Aug 26, 2024
1968f51
test
0xDEnYO Aug 26, 2024
a1459a7
test
0xDEnYO Aug 26, 2024
09ad68c
test
0xDEnYO Aug 26, 2024
802f679
test
0xDEnYO Aug 26, 2024
64ab6d8
test
0xDEnYO Aug 26, 2024
49854e8
test
0xDEnYO Aug 26, 2024
5cbb52c
test
0xDEnYO Aug 26, 2024
65dab96
test
0xDEnYO Aug 27, 2024
1ed6889
test
0xDEnYO Aug 27, 2024
d32ef5e
test
0xDEnYO Aug 27, 2024
059e02c
test
0xDEnYO Aug 27, 2024
b32c2d3
test
0xDEnYO Aug 27, 2024
ac672a4
test
0xDEnYO Aug 27, 2024
fe45f4d
test
0xDEnYO Aug 27, 2024
ee7a607
test
0xDEnYO Aug 27, 2024
72dcd3a
test
0xDEnYO Aug 27, 2024
a3666e3
test
0xDEnYO Aug 27, 2024
47fc2d9
test
0xDEnYO Aug 27, 2024
0bd0c68
test
0xDEnYO Aug 27, 2024
c24921f
test
0xDEnYO Aug 27, 2024
506ef8e
Merge branch 'main' of github.com:lifinance/contracts into gitActionTest
0xDEnYO Sep 4, 2024
1578f90
test
0xDEnYO Sep 4, 2024
719bd59
test
0xDEnYO Sep 4, 2024
26b60f1
test
0xDEnYO Sep 4, 2024
2f03017
test
0xDEnYO Sep 4, 2024
f628347
test
0xDEnYO Sep 4, 2024
cb7beb0
test
0xDEnYO Sep 4, 2024
3b26405
test
0xDEnYO Sep 4, 2024
591b304
test
0xDEnYO Sep 4, 2024
e9c9205
test
0xDEnYO Sep 4, 2024
275fb1d
Merge branch 'main' of github.com:lifinance/contracts into gitActionTest
0xDEnYO Sep 4, 2024
c8cdcc2
test
0xDEnYO Sep 4, 2024
4cf0d12
test
0xDEnYO Sep 4, 2024
8b3bf53
Merge branch 'main' of github.com:lifinance/contracts into gitActionTest
0xDEnYO Sep 4, 2024
fb51410
test
0xDEnYO Sep 4, 2024
1fd8029
test
0xDEnYO Sep 5, 2024
4766dd2
test
0xDEnYO Sep 5, 2024
408daa5
test
0xDEnYO Sep 5, 2024
7379592
test
0xDEnYO Sep 5, 2024
e48a9ab
test
0xDEnYO Sep 5, 2024
893d541
test
0xDEnYO Sep 5, 2024
f1b1557
test
0xDEnYO Sep 5, 2024
aef6a11
test
0xDEnYO Sep 5, 2024
3b3a774
test
0xDEnYO Sep 5, 2024
870a51f
test
0xDEnYO Sep 5, 2024
8bfb8d7
test
0xDEnYO Sep 5, 2024
2f2c3d2
test
0xDEnYO Sep 5, 2024
56a4c4d
test
0xDEnYO Sep 5, 2024
cfe582e
test
0xDEnYO Sep 5, 2024
a57f387
test
0xDEnYO Sep 5, 2024
c4d2ea9
test
0xDEnYO Sep 5, 2024
4300afa
test
0xDEnYO Sep 5, 2024
c837321
test
0xDEnYO Sep 5, 2024
58d08e4
test
0xDEnYO Sep 5, 2024
f907151
test
0xDEnYO Sep 5, 2024
43e0e0d
test
0xDEnYO Sep 5, 2024
79bbfee
test
0xDEnYO Sep 5, 2024
0406d7a
test
0xDEnYO Sep 5, 2024
d320478
test
0xDEnYO Sep 5, 2024
410997d
test
0xDEnYO Sep 5, 2024
240f357
test
0xDEnYO Sep 5, 2024
187dec7
Merge branch 'main' of github.com:lifinance/contracts into gitActionTest
0xDEnYO Sep 5, 2024
7aa640b
test
0xDEnYO Sep 5, 2024
95baa6e
test
0xDEnYO Sep 5, 2024
c21affa
reactivate git actions
0xDEnYO Sep 5, 2024
efef625
test
0xDEnYO Sep 5, 2024
e29684b
test
0xDEnYO Sep 5, 2024
abd9ea4
test
0xDEnYO Sep 5, 2024
62b51a8
test
0xDEnYO Sep 5, 2024
85a407f
test
0xDEnYO Sep 5, 2024
1ede586
test
0xDEnYO Sep 5, 2024
97aeb64
test
0xDEnYO Sep 5, 2024
bd3ccba
test
0xDEnYO Sep 5, 2024
2df9c33
test
0xDEnYO Sep 5, 2024
aebeaeb
test
0xDEnYO Sep 5, 2024
f473107
test
0xDEnYO Sep 5, 2024
fed0764
test
0xDEnYO Sep 5, 2024
bcfa7bb
test
0xDEnYO Sep 5, 2024
5cf4698
test
0xDEnYO Sep 5, 2024
7eb0995
test
0xDEnYO Sep 5, 2024
33815ea
test
0xDEnYO Sep 5, 2024
3b066f7
test
0xDEnYO Sep 5, 2024
3743c09
test
0xDEnYO Sep 5, 2024
8055162
test
0xDEnYO Sep 5, 2024
9a622dd
test
0xDEnYO Sep 5, 2024
b50fce3
test
0xDEnYO Sep 5, 2024
c38028a
test
0xDEnYO Sep 5, 2024
2cf5f45
test
0xDEnYO Sep 5, 2024
e0d44c1
test
0xDEnYO Sep 5, 2024
9e53ffb
test
0xDEnYO Sep 5, 2024
1a22637
test
0xDEnYO Sep 5, 2024
232f262
test
0xDEnYO Sep 5, 2024
3987184
test
0xDEnYO Sep 5, 2024
f7ff7c5
test
0xDEnYO Sep 5, 2024
e41de9f
test
0xDEnYO Sep 6, 2024
d10d432
test
0xDEnYO Sep 6, 2024
b45e588
test
0xDEnYO Sep 6, 2024
c8902ab
test
0xDEnYO Sep 6, 2024
e64cdc0
test
0xDEnYO Sep 6, 2024
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
145 changes: 145 additions & 0 deletions .github/workflows/checkAudit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# - Github Audit Checker
# - checks if an audit was conducted
# > is there at least one complete entry in the audit log for that contract/version
# - checks if all audit-related files are updated accordingly
# > is the audit report uploaded to ./audit/reports/ ?
# - checks if there is one approving review of an auditor (do we really want this?)
# - checks if the logged audit commit hash is part of the commits of this PULL_REQUEST

# KNOWN LIMITATIONS
# - will only check the last 100 commits for any matches with audit commit hashes

name: Verify Audit Information

on:
workflow_run:
workflows: ['check-audit-required', 'Audit Requirement Check'] # Only runs after the "Audit Requirement Check" workflow is completed
types:
- completed # Runs when the first workflow completes

jobs:
# - name: Check if PR is approved by auditor(s)
# id: check-auditor-approval
# uses: actions/github-script@v7
# if: env.CONTINUE == 'true'
# with:
# script: |
# const fs = require('fs');
# const auditorHandlesFile = 'auditor_handles.txt'; // Adjust this if needed

# // Read auditor handles from file
# const auditorHandles = fs.readFileSync(auditorHandlesFile, 'utf-8').split(/\r?\n/).filter(Boolean);

# const { data: reviews } = await github.pulls.listReviews({
# owner: context.repo.owner,
# repo: context.repo.repo,
# pull_number: context.issue.number,
# });

# let allApproved = true;

# auditorHandles.forEach(handle => {
# const approved = reviews.some(review => review.user.login === handle && review.state === 'APPROVED');
# if (!approved) {
# console.log(`PR is not approved by ${handle}`);
# allApproved = false;
# } else {
# console.log(`PR is approved by ${handle}`);
# }
# });

# if (!allApproved) {
# core.setFailed("Not all required auditors have approved the PR.");
# } else {
# core.setOutput('approved', 'true');
# }

- name: Check if all required commits are part of the PR
id: check_commit_hashes
if: env.CONTINUE == 'true'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');

// ANSI escape codes for colors (used for colored output in Git action console)
const colors = {
reset: "\033[0m",
red: "\033[31m",
green: "\033[32m",
yellow: "\033[33m",
};

// Read commit hashes from file
const commitHashesFile = 'commit_hashes.txt'; // Adjust this if needed
const commitHashes = fs.readFileSync(commitHashesFile, 'utf-8').split(/\r?\n/).filter(Boolean);

// Log the number of commit hashes found
console.log(`${commitHashes.length} relevant audit commit hashes found: ${commitHashes}`);


const owner = context.repo.owner;
const repo = context.repo.repo;
const pull_number = context.issue.number;

let allCommitsFound = true;

// define a function that ensures that a given commit hash is part of the current pull request
const checkCommit = async (hash) => {
try {
// get the commit through github REST API
const { data: commit } = await github.rest.repos.getCommit({
owner,
repo,
ref: hash,
});

// get all PRs associated with this commit
const associatedPRs = (await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner,
repo,
commit_sha: hash,
})).data;

// check if any of the associated PR numbers matches with <this> PR number
const isAssociatedWithPR = associatedPRs.some(pr => pr.number === pull_number);

// if current commit is not associated to this PR, end this
if (!isAssociatedWithPR) {
// console.log(`${colors.red}None of the associated PRs (${JSON.stringify(associatedPRs.map(pr => pr.number))}) of commit ${hash} matches with this PR (${pull_number})${colors.reset}`);
console.log(`${colors.red}None of the associated PRs (${associatedPRs.map(pr => pr.number)}) of commit ${hash} matches with this PR (${pull_number})${colors.reset}`);
console.log(`${colors.red}Please check if the 'auditCommitHash' in the audit log is accurate and try again.${colors.reset}`);

// set flag to false
allCommitsFound=false;

}
else console.log(`${colors.green}Commit ${hash} is associated with this PR. Check passed.${colors.reset}`)
} catch (error) {
console.log(`${colors.red}The following audit commit seems to be invalid: ${hash}${colors.reset}`);
console.log(`${colors.red}Please check if the 'auditCommitHash' in the audit log is accurate and try again.${colors.reset}`);

// set flag to false
allCommitsFound=false;
}
};

(async () => {
for (const hash of commitHashes) {
console.log(`---------------------------------------------------------------`)
console.log(`Now checking auditCommitHash: ${hash}`)

await checkCommit(hash);
}

// Set environment variable based on whether all commits are found
const envFilePath = process.env.GITHUB_ENV;
fs.appendFileSync(envFilePath, `CONTINUE=${allCommitsFound}\n`);

if (!allCommitsFound)
core.setFailed("This check failed");
else {
console.log(`${colors.green}All audit commits have been successfully verified.${colors.reset}`);
core.setOutput('all_commits_present', 'true');
}
})();
Loading
Loading