Skip to content

Commit

Permalink
Create testing.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Feb 23, 2024
1 parent 532a0bb commit 148720e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Congratulations and Label

on:
issues:
types: [opened]

jobs:
Congratulation-And-Label:
runs-on: ubuntu-latest
steps:
- name: Check if it's the first issue
id: first_issue_check
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const { data: issues } = await github.issues.listForRepo({ owner, repo });
const issueCount = issues.length;
console.log(`Total issues: ${issueCount}`);
if (issueCount === 1) {
core.setOutput('first_issue', 'true');
} else {
core.setOutput('first_issue', 'false');
}
- name: Congratulations message
if: steps.first_issue_check.outputs.first_issue == 'true'
run: |
echo "This is the first issue. Congratulations!"
# Add your label adding logic here

0 comments on commit 148720e

Please sign in to comment.