Closed hectorsector closed 5 years ago
Great! The branch cleanup action is now ready to run. Although we haven't merged this pull request, any change to this pull request triggers the action. The fact that you just committed is one of those possible triggers (it's a pull_request.synchronized
event, if you're curious).
Wait for your action to run. You can monitor its progress in the Actions tab.
The action didn't run for some reason. See your actions tab to figure out why.
Great work! Since this branch cleanup occurs after pull requests are merged, you'll notice we chose the
pull_request
for theon
attribute. Most GitHub events are available as triggers.Step 2: Add the action block
Let's now add the action block. The action block is where we choose the action we want to use. Actions can be identified in any of the following forms:
For this example, we'll use the branch cleanup action. Because this is an action in a public GitHub repository, we'll refer to it using the syntax:
jessfraz/branch-cleanup-action@master
, which tells us to use an action in the repository jessfraz/branch-cleanup-action, and to specifically pick the version of the action on the master branch.This action's purpose is to delete a branch when it is merged. To do this, the action needs access to the repository on which it is installed. In this step, we'll allow the action access to our repository by giving it access to
GITHUB_TOKEN
, an encrypted token that allows the action to perform certain functions in this repository.:keyboard: Activity: Use the branch cleanup action
main.workflow
file.jessfraz/branch-cleanup-action@master
branch cleanup
GITHUB_TOKEN
in the :lock: secrets sectionI'll respond below with your next step.