Issue with pyobjc on macOS runner in GitHub workflow - github-actions

first time posting on here so hopefully this is not an obvious question that I should be able to solve by myself (apologies if so!). I have a workflow (see below) for a GitHub Action which ran ok last week, and the exact same workflow (and code in the repository) now fails. The workflow installs python dependencies via poetry (before performing other actions), and fails with the following error in the dependency installation step, typically when the workflow is trying to install the requests or pytoolconfig packages:
ERROR: pyobjc_framework_FSEvents-8.5-cp36-abi3-macosx_11_0_universal2.whl is not a supported wheel on this platform.
Tried this both on macOS 11 and macOS12, and receive the same error. What's confusing me is that this was all working last week, and without any changes to the poetry lock file (or any of the python code), this now fails. Just for reference, the workflow runs ok on Ubuntu (it doesn't run on Windows, but that's due to some issues with Fiona and geopandas, unrelated to this question).
Any idea on why this may be happening?
Here's the workflow file:
name: mac-os-test
on: [push]
jobs:
test:
runs-on: macos-11
timeout-minutes: 30
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout#v3
- name: Set up python
id: setup-python
uses: actions/setup-python#v4
with:
python-version: '3.9'
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry#v1
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache#v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: poetry install --no-interaction
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
run: poetry run pytest
EDIT: should have added: the python package and poetry lock files were all developed on a macOS computer, and it all installs fine there too.

Related

GitHub actions not identifying environment secret tokens

I recently created two workflows that deploy a preview when a push is made to a non-release branch (incl main) and deploys a production build when pushed to the release branch. However the preview workflow is failing with the error:
Error: No existing credentials found. Please run vercel login or pass "--token"
On the line:
vercel pull --yes --environment=preview --token=
I've setup the tokens in environment secrets of the repository, and below is the workflow file:
name: Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN }}
on:
push:
branches-ignore:
- release
jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- name: "Echo values"
run: |
echo $VERCEL_PROJECT_ID
echo $VERCEL_TOKEN
- uses: actions/checkout#v2
- name: Install Vercel CLI
run: npm install --global vercel#latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
The echo isn't logging anything, not even ***(Although this isn't any important step, it was just a way to possibly debug the issue). I've followed this article from vercel to create the workflow. I'm pretty sure that the tokens are set up correctly, again at the same time, I'm unable to pinpoint the cause of the error. How do I fix this? TIA.

Bump up version in Github workflow won't change the code

I'm using python poetry as package management. For bump up the patch version, I simply run poetry version patch. I moved this function to workflow and it won't change the version string at all!
name: Bump version
on: workflow_dispatch:
inputs:
version:
description: 'Semver type of new version (major / minor / patch)'
required: true
type: choice
options:
- patch
- minor
- major
jobs: bump-version:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout#v2.4.0
- name: setup python
uses: actions/setup-python#v2
with:
python-version: '3.x'
architecture: 'x64'
- name: setup poetry
run: |
python -m pip install -U pip
pip install poetry
- name: Setup Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}#teamname.com"
- name: bump version
run: poetry version ${{ github.event.inputs.version }} #the action is not update the code
I do have the bump up version step as showing above, however, the version string was kept still after pulled and checked, can someone help me?
Possible reason: Since the workflow needs to checkout (copy the repo) fist, all changes are enter to the copied repo. If so how can I copy back?
As I mentioned, the workflow simulate what you have locally, therefore it checkout first(copy) the solution is after the version bump up just commit and push it
- name: bump up version
run: |
poetry version ${{ github.event.inputs.version }}
git add pyproject.toml
git commit -m "bump up ${{ github.event.inputs.version }} version from workflow"
git push

Unable to push my storybooks into chromatic

I have integrated chromatic into my repository and purpose is to push my storybooks into chromatic.
I have two folder in my repo: 1- backend 2- frontend and I have all storybooks in my frontend folder and my .github/workflows/chromatic.yml file looks like below:
# .github/workflows/chromatic.yml
# Workflow name
name: 'Chromatic'
# Event for the workflow
on: pull_request
# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
# Job steps
steps:
- uses: actions/checkout#v1
with:
fetch-depth: 0
- name: Install dependencies
run: yarn
# 👇 Runs yarn in ./frontend
working-directory: frontend
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action#v1
# Chromatic GitHub Action options
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
workingDir: frontend
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
Is there anything wrong in chromatic.yml file? I have set event on pull request and whenever I create pull request from my branch to another branch(dev) I received notifications that "no job were run" (also attached the screenshot). And when I click "View workflow run" button I got following error:
Error: .github#L1
The job was not started because recent account payments have failed or your spending limit needs to be increased. Please check the 'Billing & plans' section in your settings.
(I have researched this error and also tried different ways as suggested but same issue I am getting).

Does the Github Action checkout#v2 checkout .eslintrc file?

I noticed when I was trying to run my github workflow to deploy my dockerized VUE app to Elastic Beanstalk that I kept getting an error in my logs saying no eslint config found, since I had just a handful of ignore lines.
So when I added a step in the workflow to ls the files being checked out, I saw it did not grab any of the files formatted as .*.
I would assume it should at least be getting the .eslintrc.* file since it is supposed to come featured to run npm install and npm run lint it would look at the checked out config file to determine if the rules pass.
Here is my workflow up to this point:
name: Deploy to Staging Environment
on: [workflow_dispatch]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Latest Repo
uses: actions/checkout#v2
- name: List Checked Out files
run: ls
# DOES NOT SHOW ANY .* files checked out
Is anyone else noticing the same? What should I try?

Can't push to protected branch in GitHub Action

I have a GitHub action that I have created in order to create a new version and publish it for our JS repo. It looks similar to this
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout#v2
- uses: actions/setup-node#v1
with:
node-version: 12.18.3
registry-url: https://npm.pkg.github.com/
scope: '<redacted>'
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Bump Version & Push
run: |
git config --local user.email "<redacted>"
git config --local user.name "<redacted>"
npm version patch
git push https://${{ secrets.KEY }}#github.com/<redacted> HEAD:master --follow-tags
The KEY that I am using is a person access token I created from my account. I have set the repo so that I have push access to the master branch. When I try the push command from my machine with the access token it works without an issue. However every time I see this in the GitHub Action
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: You're not authorized to push to this branch. Visit https://docs.github.com/articles/about-protected-branches/ for more information.
I have been racking my brain trying to figure this out and I'm out to ideas. If I remove the branch protection this action works fine.
I think this is because of how authentication is persisted by actions/checkout. It's stored in an extraheader config option which takes precedence over the credentials you are setting manually.
Try not persisting the auth:
- uses: actions/checkout#v2
with:
persist-credentials: false
Or alternatively:
- uses: actions/checkout#v2
with:
token: ${{ secrets.KEY }}
I know this because I've had my own issue with overriding this config option in the past.