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
70 lines (58 loc) · 2.2 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
name: Submit Program
on:
issues:
types: [labeled]
jobs:
submit_program:
if: github.event.label.name == 'submit-program'
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Issue data
run: |
echo "Issue number : ${{ github.event.issue.number }}"
echo "Issue title : ${{ github.event.issue.title }}"
echo "Issue body : ${{ github.event.issue.body }}"
echo "user : ${{ github.event.issue.user.login }}"
# Accept Program
- name: Submit Program
id: submit-program
uses: ./action/
with:
SUBMIT_PROGRAM_USERNAME: ${{ github.event.issue.user.login }}
SUBMIT_PROGRAM_ISSUE_NUMBER: ${{ github.event.issue.number }}
SUBMIT_PROGRAM_TITLE: ${{ github.event.issue.title }}
SUBMIT_PROGRAM_BODY: ${{ github.event.issue.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 }}