-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e5dd7b
commit 73e02d4
Showing
6 changed files
with
121 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,58 @@ | ||
# Project Tour | ||
|
||
In the 'Contracts' folder, you'll find a single file with a '.sol' extension. This file is where you should make all your changes. Simply open this file to access the contract code and update it as needed. If you have any questions or need assistance with the changes, feel free to ask!. | ||
In the 'Contracts' folder, you'll find a single file with a '.sol' extension. This file is where you should make all your changes. Simply open this file to access the contract code and update it as needed. If you have any questions or need assistance with the changes, feel free to ask! | ||
|
||
```bash | ||
| .gitignore | ||
| CODE_OF_CONDUCT.md | ||
| commitlint.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| | ||
+---.github | ||
| +---Contributor_Guide | ||
| | commiting.md | ||
| | Contributing.md | ||
| | Project_Tour.md | ||
| | | ||
| +---ISSUE_TEMPLATE | ||
| | bug_report.yaml | ||
| | feature_request.yaml | ||
| | | ||
| +---PULL_REQUEST_TEMPLATE | ||
| | pr.md | ||
| | | ||
| \---workflows | ||
| commitlint.yaml | ||
| prmerged.yaml | ||
| | ||
+---.husky | ||
| commit-msg | ||
| pre-commit | ||
| | ||
\---contract | ||
│ .gitignore | ||
│ CODE_OF_CONDUCT.md | ||
│ commitlint.config.js | ||
│ package-lock.json | ||
│ package.json | ||
│ README.md | ||
│ | ||
├───.github | ||
│ │ pull_request_template.md | ||
│ │ | ||
│ ├───Contributor_Guide | ||
│ │ commiting.md | ||
│ │ Contributing.md | ||
│ │ Project_Tour.md | ||
│ │ | ||
│ ├───ISSUE_TEMPLATE | ||
│ │ bug_report.yaml | ||
│ │ feature_request.yaml | ||
│ │ | ||
│ ├───PULL_REQUEST_TEMPLATE | ||
│ │ pr.md | ||
│ │ | ||
│ └───workflows | ||
│ checklabels.yaml | ||
│ commitlint.yaml | ||
│ label-checker.js | ||
│ prmerged.yaml | ||
│ | ||
├───.husky | ||
│ │ commit-msg | ||
│ │ pre-commit | ||
│ │ | ||
│ └───_ | ||
│ .gitignore | ||
│ applypatch-msg | ||
│ commit-msg | ||
│ h | ||
│ husky.sh | ||
│ post-applypatch | ||
│ post-checkout | ||
│ post-commit | ||
│ post-merge | ||
│ post-rewrite | ||
│ pre-applypatch | ||
│ pre-auto-gc | ||
│ pre-commit | ||
│ pre-push | ||
│ pre-rebase | ||
│ prepare-commit-msg | ||
│ | ||
└───contract | ||
ballot_block.sol | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Label Checker | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
check-labels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install dependencies | ||
run: npm install @actions/github @actions/core | ||
- name: Run Label Checker | ||
run: node .github/workflows/label-checker.js | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { getOctokit, context } from '@actions/github'; | ||
import { setFailed } from '@actions/core'; | ||
|
||
async function run() { | ||
try { | ||
const token = process.env.GITHUB_TOKEN; | ||
const octokit = new getOctokit(token); | ||
|
||
const pullRequest = context.payload.pull_request; | ||
const owner = pullRequest.base.repo.owner.login; | ||
const repo = pullRequest.base.repo.name; | ||
const pullNumber = pullRequest.number; | ||
|
||
const { data: labels } = await octokit.rest.issues.listLabelsOnIssue({ | ||
owner, | ||
repo, | ||
issue_number: pullNumber, | ||
}); | ||
|
||
const labelNames = labels.map((label) => label.name); | ||
|
||
const requiredLabels = [ | ||
['Type:Easy', 'Type:Medium', 'Type:Hard'], | ||
['Semver:major', 'Semver:minor', 'Semver:patch'], | ||
['PR:Accept'], | ||
]; | ||
|
||
const hasRequiredLabels = requiredLabels.every((labelGroup) => | ||
labelGroup.some((label) => labelNames.includes(label)) | ||
); | ||
|
||
if (!hasRequiredLabels) { | ||
setFailed( | ||
'This pull request must have at least one label from each of the following groups: Type (Easy, Medium, Hard), Semver (Major, Minor, Patch), and PR:Accept.' | ||
); | ||
} | ||
} catch (error) { | ||
setFailed(error.message); | ||
} | ||
} | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.