Lets try to get a feel for how easy it is to create a new workflow.
In this issue:
See the web interface's built-in support for workflow files
Explore the pre-defined workflows
Browse the available actions in the marketplace
Create a new workflow
Trigger a workflow manually
[ ] π Go back to the Actions tab and hit the New worlflow button π
[ ] π Browse around - locate the "Java with Maven" CI workflow - hit Configure to see the details π
Java with Maven
...Yup! It's pretty basic. It doesn't really do any integration, so calling it CI is probably a bit overreached, but it does give you a basic skeleton.
But we don't have any Java in this repo, so let's do something else instead. Notice that when you are in a yaml file, which is located in .github/worflows and you are in edit mode in GitHub's web interface, then a right panel shows up automatically, which allows you to search the marketplace for more actions.
[ ] π Look up the action called "Issue-metrics" by GitHub π
[ ] π Choose it and view it's full marketplace listing π
If you browse to the "Getting Started" section you'll see that they actually also suggest something of a template.
I've made an even simpler version of it
[ ] π Copy the code below and paste it into a new .yml file and save it in .github/worflows π
[ ] π add, commit and push to git π
[ ] π Go the the Actions tab and see what happens? π
Code to copy
β οΈ IF THE CODE IS NOT YAML FORMATTED - please [copy the code from the template repo](https://github.com/kea-dev/dx-intro/issues/3) β οΈ
```yaml
name: Manually triggered issue metrics
on:
workflow_dispatch:
permissions:
issues: write
pull-requests: read
jobs:
build:
name: issue metrics
runs-on: ubuntu-latest
steps:
The env clause is used inside a step - not globally
There and odd looking peter-evans/create-issue-from-file action in the equation π± What is that?
This action seems to use the GitHub token in another way than we've seen before?
So it appears that nothin happens. On the Actions tab you don't see a new workflow run - but if you look closer, under "Workflows" you'll see that the new workflow is listed. If you select it you you'll see a notification the since this workflow defines a workflow_dispatch trigger, apparently you can then run it manually. In fact, since it's the only tigger defined, it's the only thing you can do with it!
[ ] π Run the workflow manually - locate the new issue created from from the run, read the reportπ
If you haven't already:
[ ] π Try to add a few comments to some of your own issues, close the ones you're done with π
[ ] π Run the workflow again - read the new reportπ
Lets try to get a feel for how easy it is to create a new workflow.
In this issue:
See the web interface's built-in support for workflow files
Explore the pre-defined workflows
Browse the available actions in the marketplace
Create a new workflow
Trigger a workflow manually
[ ] π Go back to the
Actions
tab and hit theNew worlflow
button π[ ] π Browse around - locate the "Java with Maven" CI workflow - hit
Configure
to see the details πJava with Maven
...Yup! It's pretty basic. It doesn't really do any integration, so calling it CI is probably a bit overreached, but it does give you a basic skeleton.
But we don't have any Java in this repo, so let's do something else instead. Notice that when you are in a yaml file, which is located in
.github/worflows
and you are in edit mode in GitHub's web interface, then a right panel shows up automatically, which allows you to search the marketplace for more actions.[ ] π Look up the action called "Issue-metrics" by GitHub π
[ ] π Choose it and view it's full marketplace listing π
If you browse to the "Getting Started" section you'll see that they actually also suggest something of a template.
I've made an even simpler version of it
[ ] π Copy the code below and paste it into a new
.yml
file and save it in.github/worflows
π[ ] π
add
,commit
andpush
to git π[ ] π Go the the
Actions
tab and see what happens? πCode to copy
β οΈ IF THE CODE IS NOT YAML FORMATTED - please [copy the code from the template repo](https://github.com/kea-dev/dx-intro/issues/3) β οΈ ```yaml name: Manually triggered issue metrics on: workflow_dispatch: permissions: issues: write pull-requests: read jobs: build: name: issue metrics runs-on: ubuntu-latest steps:name: Run issue-metrics tool uses: github/issue-metrics@v2 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} SEARCH_QUERY: 'repo:${{ github.repository }} is:issue'
name: Create issue uses: peter-evans/create-issue-from-file@v4 with: title: Monthly issue metrics report token: ${{ secrets.GITHUB_TOKEN }} content-filepath: ./issue_metrics.md
The trigger
on
doesn't seem to mention an event?The
env
clause is used inside a step - not globallyThere and odd looking
peter-evans/create-issue-from-file
action in the equation π± What is that?This action seems to use the GitHub token in another way than we've seen before?
So it appears that nothin happens. On the
Actions
tab you don't see a new workflow run - but if you look closer, under "Workflows" you'll see that the new workflow is listed. If you select it you you'll see a notification the since this workflow defines aworkflow_dispatch
trigger, apparently you can then run it manually. In fact, since it's the only tigger defined, it's the only thing you can do with it![ ] π Run the workflow manually - locate the new issue created from from the run, read the reportπ
If you haven't already:
[ ] π Try to add a few comments to some of your own issues, close the ones you're done with π
[ ] π Run the workflow again - read the new reportπ