github-actions

GitHub actions setup-python stopped working

GitHub actions setup-python stopped working Question: Below is my workflow file, which worked previously forever and I’ve not changed anything. env: PYTHON_VERSION: ‘3.8.9’ jobs: build: name: build runs-on: ubuntu-latest steps: – uses: actions/checkout@v3 – uses: actions/setup-python@v3 with: python-version: ${{ env.PYTHON_VERSION }} – run: mkdir file-icons product-icons – run: python3 -m translate – uses: actions/upload-artifact@v3 with: …

Total answers: 1

Not able to copy file in docker file which is downloaded in github actions

Not able to copy file in docker file which is downloaded in github actions Question: I can able to see the .pkl which is downloaded using actions/download-artifact@v3 action in work directory along with Dockerfile as shown below, When I try to COPY file inside Dockefile, I get a file not found error. How to copy …

Total answers: 1

Check if we're in a GitHub Action / tracis ci / circle ci etc. testing environment

Check if we're in a GitHub Action / tracis ci / circle ci etc. testing environment Question: I would like to programatically determine if a particular Python script is run a testing enviroment such as GitHub action Tracis CI Circle CI etc. I realize that this will require some heuristics, but that’s good enough for …

Total answers: 1

Write multi-line secret to windows runner in GitHub workflow

Write multi-line secret to windows runner in GitHub workflow Question: Summary What specific syntax must be changed in the code below in order for the multi-line contents of the $MY_SECRETS environment variable to be 1.) successfully written into the C:\Users\runneradmin\somedir\mykeys.yaml file on a Windows runner in the GitHub workflow whose code is given below, and …

Total answers: 4

How to access GitHub action secrets with python?

How to access GitHub action secrets with python? Question: I have environment secrets set up in a Python GitHub actions project: I can access the secrets from the actions file, because the following: jobs: log-the-inputs: runs-on: ubuntu-latest steps: – run: | echo "Log level: $LEVEL" echo "Tags: $TAGS" echo "Environment: $ENVIRONMENT" echo ${{ secrets.EMAIL_USER }} …

Total answers: 1

Pylint fail under does not fail my Github action job

Pylint fail under does not fail my Github action job Question: I am trying to implement a python linter using pylint. But i am getting the score of each python file and also displaying the suggestion to improve the score but I am also looking to terminate the GitHub action job if my pylint score …

Total answers: 3

GitHub action couldn't find environment variable for Django

GitHub action couldn't find environment variable for Django Question: I was trying to use the environment variable in my Django application where I use the django-environ package with the .env file in my local machine. But I can’t use the .env file in my GitHub action. I’ve configured action secret variables manually from my project …

Total answers: 1

How to solve JSONDecodeError when using Poetry in Github Actions?

How to solve JSONDecodeError when using Poetry in Github Actions? Question: Issue I’ve got a problem using poetry install in my CI/CD pipeline (Github Actions), on any GitHub runner, since I migrated from Python 3.8 to Python 3.10. Installing dependencies from lock file Package operations: 79 installs, 0 updates, 0 removals • Installing pyparsing (3.0.9) …

Total answers: 1

How to mask environment variables created in Github when running a workflow?

How to mask environment variables created in Github when running a workflow? Question: I created a Github workflow that runs a python script with a cron schedule. On every run of the workflow an access_token is generated, which is required during the next run. To save the token the python script writes the token to …

Total answers: 2