https://github.com/leo-gan/skills-hello-github-actions
My clone repository
https://github.com/leo-gan/skills-hello-github-actions
Last synced: about 2 months ago
JSON representation
My clone repository
- Host: GitHub
- URL: https://github.com/leo-gan/skills-hello-github-actions
- Owner: leo-gan
- License: mit
- Created: 2023-12-22T23:23:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-22T23:42:46.000Z (over 1 year ago)
- Last Synced: 2024-10-29T09:05:12.593Z (7 months ago)
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hello GitHub Actions
_Create a GitHub Action and use it in a workflow._
## Step 3: Add actions to your workflow file
_Nice work adding a job to your workflow! :dancer:_
Workflows have jobs, and jobs have steps. So now we'll add steps to your workflow.
**What are _steps_?**: Actions steps will run during our job in order. Each step is either a shell script that will be executed, or an action that will be run. Each step must pass for the next step to run. Actions steps can be used from within the same repository, from any other public repository, or from a published Docker container image.
In our action, we post a comment on the pull request using a [bash](https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29) script and [GitHub CLI](https://cli.github.com/).
### :keyboard: Activity: Add Actions steps to your workflow file
1. Open your `welcome.yml` file.
2. Update the contents of the file to:
```yaml
name: Post welcome comment
on:
pull_request:
types: [opened]
permissions:
pull-requests: write
jobs:
build:
name: Post welcome comment
runs-on: ubuntu-latest
steps:
- run: gh pr comment $PR_URL --body "Welcome to the repository!"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
```
3. Click **Start commit** in the top right of the workflow editor.
4. Type your commit message and commit your changes directly to your branch.
5. Wait about 20 seconds for actions to run, then refresh this page (the one you're following instructions from) and an action will automatically close this step and open the next one.---
Get help: [Post in our discussion board](https://github.com/orgs/skills/discussions/categories/hello-github-actions) • [Review the GitHub status page](https://www.githubstatus.com/)
© 2023 GitHub • [Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/code_of_conduct.md) • [MIT License](https://gh.io/mit)