This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 167
77 lines (64 loc) · 2.34 KB
/
submit-program.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Submit Program
on:
issues:
types: [labeled]
jobs:
submit_program:
# run only if repo is not a fork
if: github.repository == 'codinasion/codinasion' && github.event.action == 'labeled' && github.event.label.name == 'submit-program'
runs-on: ubuntu-latest
env:
NUMBER: ${{ github.event.issue.number }}
TITLE: ${{ github.event.issue.title }}
BODY: ${{ github.event.issue.body }}
USER: ${{ github.event.issue.user.login }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Issue data
run: |
echo "Issue number : $NUMBER"
echo "Issue title : $TITLE"
echo "Issue body : $BODY"
echo "user : $USER"
# Accept Program
- name: Submit Program
id: submit-program
uses: ./action/
with:
SUBMIT_PROGRAM_USERNAME: ${{ env.USER }}
SUBMIT_PROGRAM_ISSUE_NUMBER: ${{ env.NUMBER }}
SUBMIT_PROGRAM_TITLE: ${{ env.TITLE }}
SUBMIT_PROGRAM_BODY: ${{ env.BODY }}
# Trigger
TRIGGER_SUBMIT_PROGRAM: true
# Secrets
GITHUB_TOKEN: ${{ secrets.CODINASION_REPO_TOKEN }}
# Create Pull Request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "Accept Program #${{ github.event.issue.number }}"
body: |
Issue Title: ${{ github.event.issue.title }}
Issue Number: #${{ github.event.issue.number }}
branch: "accept-program-${{ github.event.issue.number }}"
base: master
labels: "program"
add-paths: |
program/data/programs.json
committer: Harsh Raj <harshraj8843@users.noreply.github.com>
author: Harsh Raj <harshraj8843@users.noreply.github.com>
commit-message: Accept Program - ${{ github.event.issue.number }}
token: ${{ secrets.CODINASION_REPO_TOKEN }}
# Comment & Close
- name: Comment & Close
if: steps.submit-program.outputs.submit-success == 'true'
uses: ./action/
with:
SUBMIT_PROGRAM_ISSUE_NUMBER: ${{ github.event.issue.number }}
# Trigger
TRIGGER_SUBMIT_PROGRAM_COMMENT_CLOSE: true
# Secrets
GITHUB_TOKEN: ${{ secrets.CODINASION_REPO_TOKEN }}