leo-gan / skills-hello-github-actions

My clone repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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! 💃

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 script and GitHub CLI.

⌨️ Activity: Add Actions steps to your workflow file

  1. Open your welcome.yml file.
  2. Update the contents of the file to:
    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 boardReview the GitHub status page

© 2023 GitHub • Code of ConductMIT License

About

My clone repository

License:MIT License