-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* edit test * trigger on push * add con group for linter * more test * quote string * typo * update test * test build job * update printing * auto close test issues * pr tests * test action typo * add a bot label
- Loading branch information
Showing
3 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Auto Issue closer | ||
on: | ||
issues: | ||
types: | ||
- labeled | ||
- opened | ||
jobs: | ||
delete-test-issues: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
is_test=$(echo "${{ toJSON(github.event) }}" | jq '.issue.labels[].name == "test"' | grep true) | ||
if [[ -z "$is_test" ]]; then | ||
curl --slient --show-error \ | ||
--request PATCH \ | ||
--header "Accept: application/vnd.github.v3+json" \ | ||
--header "Authorization: token ${{ secrets.PAT }}" \ | ||
--url "https://api.github.com/repos/dacbd/create-issue-action/issues/${{ github.event.issue.number }}" \ | ||
--data '{"state":"closed"}' | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,60 @@ | ||
name: Basic test on PR | ||
name: Basic Tests | ||
on: | ||
push: | ||
pull_request: | ||
branches: main | ||
workflow_dispatch: | ||
jobs: | ||
test: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Test action on PR | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: test new issue | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
- run: | | ||
echo "todo" | ||
npm install | ||
npm run build | ||
if [[ -z $(git status --porcelain) ]]; then | ||
echo "good" | ||
else | ||
echo "Forgot to commit 'npm run build'?" | ||
git status | ||
exit 1 | ||
fi | ||
pr-test: | ||
if: github.event_name == 'pull_request' | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: test | ||
uses: ./ | ||
with: | ||
token: ${{ github.token }} | ||
title: Simple test issue | ||
token: ${{ secrets.PAT }} | ||
title: "PR test from: `${{ github.ref_name }}`" | ||
body: | | ||
This is a test that includes a multiline string. | ||
Created by https://github.com/DanielBarnes/create-issue-action/actions/runs/${{ github.run_id }} | ||
# Test | ||
multiline | ||
labels: test,bot | ||
assignees: dacbd | ||
push-test: | ||
if: github.event_name == 'push' | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
echo "todo" | ||
trigger-test: | ||
if: github.event_name == 'workflow_dispatch' || github.ref_name == 'main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
curl --silent --show-error \ | ||
--request POST \ | ||
--header "Authorization: token ${{ secrets.PAT }}" \ | ||
--header "Accept: application/vnd.github.v3+json" \ | ||
--url "https://api.github.com/repos/dacbd/err/dispatches" \ | ||
--data '{"event_type":"basic", "client_payload": {"ref_name":"${{ github.ref_name }}"}}' |