├── .github ├── ISSUE_RESPONSES │ └── comment.md └── workflows │ └── my-workflow.yml ├── LICENSE └── README.md /.github/ISSUE_RESPONSES/comment.md: -------------------------------------------------------------------------------- 1 | ## Thank you! 2 | 3 | We appreciate your contribution to this project! Please be sure to read the **contributing guide** to learn how you can help make this project better! 4 | 5 | If you've created this issue with the 'bug' label, rest assured that we've added it to backlog for triage. 6 | -------------------------------------------------------------------------------- /.github/workflows/my-workflow.yml: -------------------------------------------------------------------------------- 1 | name: Learning GitHub Script 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | jobs: 8 | comment: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout repo 12 | uses: actions/checkout@v2 13 | 14 | - name: Comment on new issue 15 | uses: actions/github-script@0.8.0 16 | with: 17 | github-token: ${{secrets.GITHUB_TOKEN}} 18 | script: | 19 | const fs = require('fs') 20 | const issueBody = fs.readFileSync(".github/ISSUE_RESPONSES/comment.md", "utf8") 21 | github.issues.createComment({ 22 | issue_number: context.issue.number, 23 | owner: context.repo.owner, 24 | repo: context.repo.repo, 25 | body: issueBody 26 | }) 27 | 28 | - name: Add issue to project board 29 | if: contains(github.event.issue.labels.*.name, 'bug') 30 | uses: actions/github-script@0.8.0 31 | with: 32 | github-token: ${{secrets.GITHUB_TOKEN}} 33 | script: | 34 | github.projects.createCard({ 35 | column_id: 18806811, 36 | content_id: context.payload.issue.id, 37 | content_type: "Issue" 38 | }); 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | (MIT License) 2 | 3 | Copyright (C) 2016 Thomas Friese, http://tasmo.rocks 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to this course, GitHub Actions: Using GitHub Script! 2 | 3 | We are so excited to help you continue learning GitHub Actions through Learning Lab. This course will show you how to use an aciton called `GitHub Script` to quickly interact with the GitHub API directly in your workflow files! 4 | 5 | --- 6 | 7 | Head over the the open issue in this repository to get started :tada: 8 | 9 | --------------------------------------------------------------------------------