GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - probot/example-github-action: Probot & GitHub Action example

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
BranchesTags
Open more actions menu

Latest commit

 

History

275 Commits
275 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
dist
dist
 
 
test
test
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 
app.js
app.js
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

Probot & GitHub Action example

This repository is an example of how to create a GitHub Action using Probot

Build Status

If you build a GitHub Action using Probot, we recommend you watch this repository as we will keep updating it implementing best practises and new APIs.

Usage

You can use the action from this example repository:

name: Say Hello World
on:
  issues:
    types:
      - opened

jobs:
  sayHelloWorld:
    runs-on: ubuntu-latest
    steps:
      - uses: probot/example-github-action@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

See the action in ... action #1

Alternatively, you can pass the token with with:

- uses: probot/example-github-action@v1
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    # or
    # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Configuration

GitHub App authentication via APP_ID/PRIVATE_KEY is not supported. Only token authentication is supported by setting GITHUB_TOKEN.

Note that the LOG_LEVEL environment variable is ignored. Debug logs are not logged by default in GitHub Actions, but can be enabled by creating a ACTIONS_STEP_DEBUG repository secret and setting it to 1.

How it works

The Probot application function is defined in app.js.

The Action will run the index.js file which verifies the required environment variables are set, loads the Probot application function and then receives the event from the file system.

Important: GitHub Actions do not automatically install npm dependencies. Because you need to use @probot/github-action and probably other external dependencies, you need to bundle your app into a single file and reference that file as entry run.mains in your action.yml file. You can use ncc for that.

This repository is continuously publishing new versions to the special v1 branch using semantic-release. See package.json. Relevant bits are

  1. "build": "ncc build index.js -o dist" script - bundle the app into dist/index.js
  2. "release" - configure publishing from the "main" branch, and configure the git plugin to add a commit after publishing

The other relevant bit is .github/workflows/release.yml, which is run on each push to the default branch (main). It installs all dependencies, runs the build script, runs semantic-release which creates the GitHub release based on semantic commit message conventions (fix: ..., feat: ...) and commits the dist/index.js file. Then it pushes the changes to the v1 branch, so that users will always get the latest version when referencing probot/exmaple-github-action@v1. If there should ever be a breaking change, we would change the publish branch to v2, etc.

License

ISC

About

Probot & GitHub Action example

Resources

Readme
ISC license

Code of conduct

Code of conduct
Activity
Custom properties

Stars

34 stars

Watchers

3 watching

Forks

23 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.