Thursday, November 4, 2021

Checkout a github repo with ready made action or manual steps. Using a custom action available from another repo or market place.Using output from another step

 for generating token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

#github.com/actions/hello-world-javascript-action
name: Actions Workflow
on: [push]

jobs:
  run-github-actions:
    runs-on: ubuntu-latest
    steps:
      - name: List Files
        run: |
          pwd
          ls -a
          whoami
          hostname
          echo $GITHUB_SHA $GITUB_REPOSITORY $GITHUB_WORKSPACE
          echo "${{github.token}}"
          #git clone git@github.com:$GITUB_REPOSITORY
          #git checkout $GITHUB_SHA
      - name: Checkout
        uses: actions/checkout@v2.4.0
      - name: List Files
        run: |
          pwd
          ls -a
          whoami
          hostname
      - name: Simple JS Action
        id: greet
        uses: actions/hello-world-javascript-action@v1 #release or branch name or specific commit. Or a local yaml using ./
        with: 
          who-to-greet: John #Inputs mentioned in action documentation
      - name: Log greeting time
        run: echo "${{ steps.greet.outputs.time}}"

No comments:

Post a Comment