mirror of
https://github.com/PlaneQuery/OpenAirframes.git
synced 2026-04-26 04:56:24 +02:00
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Approve Community Submission
|
|
|
|
on:
|
|
issues:
|
|
types: [labeled]
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
issues: write
|
|
|
|
jobs:
|
|
approve:
|
|
if: github.event.label.name == 'approved' && contains(github.event.issue.labels.*.name, 'validated')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install dependencies
|
|
run: pip install jsonschema
|
|
|
|
- name: Get issue author ID
|
|
id: author
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const issue = context.payload.issue;
|
|
core.setOutput('username', issue.user.login);
|
|
core.setOutput('user_id', issue.user.id);
|
|
|
|
- name: Process and create PR
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
ISSUE_BODY: ${{ github.event.issue.body }}
|
|
run: |
|
|
python -m src.contributions.approve_submission \
|
|
--issue-number ${{ github.event.issue.number }} \
|
|
--issue-body "$ISSUE_BODY" \
|
|
--author "${{ steps.author.outputs.username }}" \
|
|
--author-id ${{ steps.author.outputs.user_id }}
|