[NFT Token]: test #25
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
name: Generate Token From Issue | |
on: | |
issues: | |
types: | |
- opened | |
- edited | |
jobs: | |
issue-to-pr: | |
name: Issue To Pr | |
runs-on: ubuntu-latest | |
outputs: | |
branch-name: new-token/${{ steps.issue-parser.outputs.issueparser_address1 }} | |
pr-number: ${{ steps.create-pr.outputs.pull-request-number }} | |
address1: ${{ steps.issue-parser.outputs.issueparser_address1 }} | |
address2: ${{ steps.issue-parser.outputs.issueparser_address2 }} | |
token-type: ${{ steps.issue-parser.outputs.issueparser_tokenType }} | |
scroll-env: ${{ steps.issue-parser.outputs.issueparser_scrollEnvironment }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Install dependencies | |
run: yarn | |
- name: Parse Issue Body | |
uses: stefanbuck/github-issue-praser@v3 | |
id: issue-parser | |
with: | |
template-path: .github/ISSUE_TEMPLATE/add_token.yml | |
- name: Parse Token | |
id: parse-token | |
run: node scripts/parseToken.mjs | |
env: | |
RESOLVED_TOKEN_STR: ${{ steps.issue-parser.outputs.jsonString }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ steps.issue-parser.outputs.issueparser_scrollEnvironment }} | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Install dependencies | |
run: yarn | |
- name: Add Token | |
id: add-token | |
run: node scripts/addToken.mjs | |
env: | |
NEW_TOKEN: ${{ steps.parse-token.outputs.new-token }} | |
- name: Create Pull Request | |
id: create-pr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
title: '[New NFT Token]: ${{ steps.issue-parser.outputs.issueparser_address1 }} & ${{ steps.issue-parser.outputs.issueparser_address2 }}' | |
body: 'Refer Issue: #${{ github.event.issue.number }}' | |
commit-message: add new token | |
base: ${{ steps.issue-parser.outputs.issueparser_scrollEnvironment }} | |
branch: new-token/${{ steps.issue-parser.outputs.issueparser_address1 }} | |
delete-branch: true | |
add-paths: scroll.tokenlist.json | |
labels: | | |
new token | |
duplicate-detection: | |
name: Duplicate Detection | |
runs-on: ubuntu-latest | |
needs: issue-to-pr | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ needs.issue-to-pr.outputs.branch-name }} | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Install dependencies | |
run: yarn | |
- name: Run Duplicate Detection Script | |
id: duplicate-detection | |
run: node scripts/checkDuplication.mjs | |
- name: Show Token Map Info | |
if: steps.duplicate-detection.outputs.duplicated == 'false' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
**@Holybasil please add token map** | |
| env | ${{needs.issue-to-pr.outputs.scroll-env }} | | |
| ------------- | ------------- | | |
| tokenType | ${{ needs.issue-to-pr.outputs.token-type }} | | |
| L1 | ${{ needs.issue-to-pr.outputs.address1 }} | | |
| L2 | ${{ needs.issue-to-pr.outputs.address2 }} | | |
pr_number: ${{needs.issue-to-pr.outputs.pr-number}} | |
- name: Show Error Message | |
if: steps.duplicate-detection.outputs.duplicated == 'true' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
Duplicate contract address detected, please update. | |
pr_number: ${{needs.issue-to-pr.outputs.pr-number}} | |
- name: Mark Pr Duplicate | |
if: steps.duplicate-detection.outputs.duplicated == 'true' | |
uses: andymckay/[email protected] | |
with: | |
add-labels: 'duplicate' | |
issue-number: ${{needs.issue-to-pr.outputs.pr-number}} | |
- name: Mark Issue Need Update | |
if: steps.duplicate-detection.outputs.duplicated == 'true' | |
uses: andymckay/[email protected] | |
with: | |
add-labels: 'need update' |