Cannot find status check in github > repository > settings > branches - github

I'm following the documentation but I don't see my check available in the search bar.
The documentation seems to think that the check will show up automatically but its not happening for me. It is a private repository but I also have Pro.
Do I need to have anything special in my yaml file? Or am I doing something else wrong? Do I just need to wait?
test.yml
name: Foo
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
timeout-minutes: 2
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout#v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install --immutable
- run: yarn lint
- run: yarn types

Searching on "build" worked.
I had only searched by "Foo" and "test". smh.
Thank you #rethab

Related

Versions and Tags Not Being Created Properly on Github

I have modified the Github workflow on a practice app to make it change version and patch with every push to the master branch.
In Github workflows - it says this process has been successful:
However when I check under releases and tags - no releases or tags are listed.
Is there something I'm missing, here is my pipeline.yml
name: Deployment pipeline
on:
push:
branches:
- master
pull_request:
branches: [master]
types: [opened, synchronize]
jobs:
simple_deployment_pipeline:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout#v3
- uses: actions/setup-node#v3
with:
node-version: '16'
- name: npm install
run: npm install
- name: lint
run: npm run eslint
- name: build
run: npm run build
- name: test
run: npm run test
- name: e2e tests
uses: cypress-io/github-action#v4
with:
build: npm run
start: npm run start-prod
wait-on: http://localhost:5000
tag_release:
needs: [simple_deployment_pipeline]
runs-on: ubuntu-20.04
steps:
- name: Bump version and push tag
uses: anothrNick/github-tag-action#1.36.0
if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ' '), '#skip') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
RELEASE_BRANCHES: master
The log under tag_release looks like this:
Your problem, which can be inferred by the error message, is that you haven't checked out the code inside the job. This is noted in the readme of the dependent action.
name: Bump version
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout#v3
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action#v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This is a common mistake, many assume that the code should exist in the job by default, but once you get varying type of workflows you will understand some use cases where you don't actually need to checkout the local git repo.
Take a look at the action you are using and consider sticking to the #v1 tag or at the very least pick a more recent version (1.36 is over a year old).

Github Actions - Cypress

I followed official Cypress documentation, and below I will attach my github workflow, but problem is it goes different way in my case. When actions run, Cypress starts downloading something, but it never ends (I waited 1.5 hour).
env:
NODE_PATH: 'src/'
#.. local env
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [ 14.x ]
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Server start
uses: cypress-io/github-action#v2
with:
build: npm run build
start: npm start
spec: cypress/integration/*.js
env:
ELECTRON_ENABLE_STACK_DUMPING: 1
- name: Exist check
# Only runs if all of the files exists
run: |
if [ -d "/..." ]
then
rm -r /...
mv build /...
fi
Problem is old version of ubuntu. change version or mention it in yaml.

how to run GitHub Action after outage?

As you may (or may not) know yesterday was a major incident of GitHub's services: https://www.githubstatus.com/incidents/tyc8wpsgr2r8.
Unfortunately I published a release during that time and the action responsible for building and publishing the code didn't trigger.
For actions which were executed at least once I have an option to "Re-run workflow" - but how can I proceed with an action which didn't even trigger - I can not see it anywhere whatsoever?
I think the last resort would be to just make another release, remove the problematic one etc. but I'd like to avoid that.
The workflow file:
name: Node.js CI
on:
push:
branches: [master]
release:
types: [published]
pull_request:
branches: [master]
jobs:
test:
name: Test Node.js v${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 16
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install --production=false --no-package-lock
- name: Lint 💅🏻
run: npm run lint
- run: npm test
release:
name: Publish NPM Package
if: startsWith(github.ref, 'refs/tags/')
needs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- uses: actions/setup-node#v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm install --production=false --no-package-lock
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
gh-pages:
name: Publish GitHub Pages
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
needs:
- test
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout#v2
- uses: actions/setup-node#v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Install ✔️
run: npm install --production=false --no-package-lock
- name: Build storybook 🏗️
run: npm run build-storybook
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action#4.1.3
with:
branch: gh-pages
folder: storybook-static
As you said in the comment, the easiest solution would be to remove the release and create it all over again.
Another option could be to add a workflow_dispatch event trigger to the workflow with a tag input, updating the jobs condition to use this input.tag variable if informed.
That way, if an automatic trigger failed (through push, release or pull_request), you could trigger it manually through the Github UI or the GH CLI as an alternative.

github action runner showing "idle" and not updating the main website

I have been using DigitalOcean: if I change or commit repository the website not being updated.
I am using just one master branch, I had 23 file changes but on the site no effects.
here is my action code:
name: Node.js CI
on:
push:
branches: [ master ]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i
- run: npm run build --if-present
- run: npm test
if I change or commit repository the website not being updated.
I am using just one master branch,
First, a change or commits are local actions: you need to push (git push) to GitHub in order for any action to have a chance to run.
Second, assuming that you have pushed, but your workflow was not triggered, add a on: directive (that you have) and double-check your default branch: recent repositories are using main, not master.
You can see an example in the official GitHub documentation "Building and testing Node.js / Starting with the Node.js workflow template":
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
Third, if you need to see some effect on a DigitalOcean Droplet, you might need to use digitalocean/action-doctl, in order to deploy (to DigitalOcean) what your GitHub action has build on GitHub side.

New GitHub actions run in empty folders

I am working with new GitHub actions, idea of a workflow below is to run when pr is opened or synchronised, it should first check out and install dependencies and afterwards run few yarn scripts
name: PR to Master
on:
pull_request:
branches:
- master
jobs:
# Synchronize or Opened
synchronized_or_opened:
name: Synchronize or Opened
runs-on: ubuntu-latest
steps:
- uses: actions/bin/filter#master
with:
args: action 'opened|synchronize'
# Add Labels
add_labels:
name: Add Labels
runs-on: ubuntu-latest
steps:
- uses: actions/labeler#v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
needs: synchronized_or_opened
# Checkout
checkout:
name: Checkout
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#master
needs: synchronized_or_opened
# Install Dependencies
install_dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- run: yarn dep:install-npm
needs: checkout
# Typecheck
typecheck:
name: Typecheck
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- run: yarn typecheck
needs: install_dependencies
# Prettier
prettier:
name: Prettier
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- run: yarn prettier
needs: install_dependencies
# ESLint
eslint:
name: ESlint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- run: yarn eslint
needs: install_dependencies
# Danger
danger:
name: Danger
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- run: yarn danger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
needs: install_dependencies
At the moment it successfully gets to a checkout stage, but once Install job is ran I get following error
error Couldn't find a package.json file in
"/home/runner/work/myRepo/myRepo"
Judging by this checkout either failed or I am in a wrong folder?
As mentioned in the Workflow syntax docs:
Each job runs in a fresh instance of the virtual environment specified by runs-on.
From what I can see here, you're doing the checkout step in a completely separate job from others. Doing it that way it does not affect other jobs in any way. It should actually be defined inside those jobs where your npm CLI commands are executed.
Here's an example of how it would look like in one of your jobs:
jobs:
# (...) Other jobs
# Install Dependencies
install_dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout#master
- run: yarn dep:install-npm
needs: checkout
# (...) Other jobs
There are some general examples in GitHub starter workflow templates.