Skip to content

tokens plz 3

tokens plz 3 #8

Workflow file for this run

name: Dispatch Token Request
on:
issues:
types: [opened]
jobs:
fetch-opened-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
- name: Fetch Opened Issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
issue_number=${{ github.event.issue.number }}
issue_body="${{ github.event.issue.body }}"
issue_author="${{ github.event.issue.user.id }}"
issue_json=$(jq -n \
--arg number "$issue_number" \
--arg body "$issue_body" \
--arg author "$issue_author" \
'{number: $number, body: $body, author: $author}')
echo "$issue_json" > opened_issue.json
echo "Fetched issue details: $issue_json"
- name: Install Deps
run: npm install
- name: Process Request
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
run: npm start
- name: Close the Issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
issue_number=${{ github.event.issue.number }}
gh issue close "$issue_number" --reason "completed"
echo "Closed issue #$issue_number"
- name: Rename and Upload the JSON File
if: ${{ hashFiles('requests.json') != '' }}
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add requests.json
git commit -m "Update requests.json"
git push