diff --git a/.github/ISSUE_TEMPLATE/ctf-template.yml b/.github/ISSUE_TEMPLATE/ctf-template.yml new file mode 100644 index 0000000..18b5069 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ctf-template.yml @@ -0,0 +1,15 @@ +name: Employee Registration +description: Complete your registration to get access to the Nova Corps database. +title: "[NC] Employee Registration" +labels: [] +assignees: [] +body: + - type: input + id: username + attributes: + label: Username + description: "Please enter your Nova Corps username" + placeholder: "CTFUser" + validations: + required: true + diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 0000000..4fff16a --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,21 @@ +name: "Cleanup" +permissions: + actions: write + +on: + workflow_run: + workflows: [Create PR] + types: + - completed + +jobs: + del_runs: + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 0 + keep_minimum_runs: 0 \ No newline at end of file diff --git a/.github/workflows/create-pr.yml b/.github/workflows/create-pr.yml new file mode 100644 index 0000000..f84a5e2 --- /dev/null +++ b/.github/workflows/create-pr.yml @@ -0,0 +1,30 @@ +name: Create PR +on: + workflow_dispatch: + inputs: + owner: + description: "Owner" + required: true + username: + description: "Username" + required: true + forkName: + description: "Fork Name" + required: true +jobs: + verify: + name: Submit PR + runs-on: ubuntu-latest + steps: + - name: Check fork + if: github.event.repository.fork == true + run: | + echo "This workflow must run on the parent repository" + exit 1 + - name: open-pull-request + uses: fjogeleit/http-request-action@v1 + with: + url: "https://api.github.com/repos/${{ inputs.username }}/${{ inputs.forkName }}/pulls" + method: "POST" + customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.USER_PAT }}", "X-GitHub-Api-Version":"2022-11-28"}' + data: '{ "title":"Step 2", "body":"##Nova Corps Employee Registration\n\nReview PR for further details.", "head":"${{ inputs.owner }}:${{ inputs.username }}", "base":"main" }' diff --git a/.github/workflows/submit-token.yml b/.github/workflows/submit-token.yml new file mode 100644 index 0000000..ec90acd --- /dev/null +++ b/.github/workflows/submit-token.yml @@ -0,0 +1,41 @@ +name: Submit Employee Verification +on: + workflow_dispatch: + inputs: + username: + description: "Nova Corps Username" + required: true + verificationCode: + description: "Token" + required: true +jobs: + verify: + name: Submit Verification + runs-on: ubuntu-latest + steps: + - name: Check fork + if: github.event.repository.fork == false + run: | + echo "This workflow must run on your fork" + exit 1 + + - name: Mask Input + id: add_mask + run: | + VERIFICATION_CODE=$(jq -r '.inputs.verificationCode' $GITHUB_EVENT_PATH) + echo ::add-mask::$VERIFICATION_CODE + echo SECRET_CODE="$VERIFICATION_CODE" >> $GITHUB_ENV + + - name: Submit Verification + id: verification + uses: fjogeleit/http-request-action@v1 + with: + url: "https://engine.rewst.io/webhooks/custom/trigger/0190fba7-081e-742e-a14a-c42dacfac02c/019017b6-72c5-751d-8e29-d354b64e3420" + method: "POST" + customHeaders: '{"Content-Type": "application/json", "x-rewst-secret": "Tributary-Flashbulb-Shaky" }' + data: '{ "username": "${{ inputs.username }}", "token": "${{ env.SECRET_CODE }}", "ghuser": "${{ github.event.sender.id }}" }' + timeout: 30000 + + - name: Submission Response + run: | + echo ${{ fromJson(steps.verification.outputs.response).response }} >> $GITHUB_STEP_SUMMARY diff --git a/README.md b/README.md new file mode 100644 index 0000000..09c7f2a --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Nova Corps Employee Registration + +![](https://static.wikia.nocookie.net/marvels-guardians-of-the-galaxy/images/2/21/Nova_Corps_banner.png/revision/latest?cb=20240217233012) + +Welcome to the Nova Corps, esteemed new recruits! As integral members of this elite intergalactic force, you’re stepping into a legacy of valor and justice. The Nova Corps is dedicated to protecting the universe from cosmic threats, upholding peace, and ensuring the safety of countless civilizations. Our mission spans from the far reaches of the cosmos to the very heart of the galaxy, and you will be at the forefront of this noble cause. Your training will be rigorous, and the responsibilities immense, but you will be supported by a team of the galaxy's finest. Welcome aboard! + +Start by submitting your personal information info the Nova Corps Database. If you have any issues, be sure to let us know.