github-actions

How to use Github Release Version Number in Github Action

可紊 提交于 2020-01-16 16:45:12
问题 I have created a Github repo that has got an action to build the npm package and publish it to npmjs.com. The trigger for my action is the creation of a new release in Github. When creating the new release, Github is asking me for a version number. I would love to use this version number in the Action and provide it to the yarn publish command. My ci-file looks like this (i stripped some parts that are not important here): name: Deploy npm package on: release: types: [created] jobs: publish

How can I reference other actions from my GitHub Action's action.yml file?

大城市里の小女人 提交于 2020-01-06 05:23:48
问题 Is it possible to reference another GitHub Action from my action.yml file? Note, I'm talking about an action here, not a workflow. I know this can be done with workflows, but can actions reference other actions? 回答1: The answer seems to be: You can't. However, I ended up internally downloading the different actions from NPM, and then re-using them within my own action. Probably not a good idea in general, but this particular action I am making is designed to run on my own projects without

Tagging, and building and uploading a python library

烈酒焚心 提交于 2020-01-05 08:32:30
问题 I have a github action that runs when a branch is merged into master. It should tag the repo with a version number that it obtains from setup.py, and then push the tag. It should then build the package and upload it to a package repository. Progress so far: Building and uploading works, tagging does not name: Deploy Library on [push] jobs: build: runs-on: ubuntu latest steps: - uses: actions/checkout@master - name: Set up Python env uses: actions/setup-python@v1 with: python-version: '3.6' -

GitHub Actions workflow error: Permission denied

心已入冬 提交于 2020-01-05 04:11:27
问题 I'm running a GitHub Actions workflow and it is failing with the following error. Unhandled exception: FileSystemException: Cannot create file, path = '/github/home/.flutter' (OS Error: Permission denied, errno = 13) I looked in Workflow syntax for GitHub Actions but couldn't find any instruction to solve this. My build file is looking like this: name: Flutter CI on: [push] jobs: build: runs-on: ubuntu-latest container: image: cirrusci/flutter:v1.7.8-hotfix.4 steps: - uses: actions/checkout

Github Actions: check steps status

流过昼夜 提交于 2020-01-04 01:55:15
问题 I have in my job for CI some steps which can throw an error. I don't want restart workflow on every step with error and want to go to the last step that checks those steps and complete this job as fail. But I can't get status info previously steps. name: CI on: [pull_request] jobs: myjob: runs-on: ubuntu-latest steps: - name: Step 1 id: hello run: <any> continue-on-error: true - name: Step 2 id: world run: <any> continue-on-error: true - name: Check on failures if: job.steps.hello.status ==

Github Actions, how to share a calculated value between job steps?

做~自己de王妃 提交于 2019-12-29 06:24:05
问题 Is there a DRY way to calculate and share a value in multiple job steps with Github Actions? In the below workflow yml file, echo ${GITHUB_REF} | cut -d'/' -f3`-${GITHUB_SHA} is repeated in multiple steps. name: Test, Build and Deploy on: push: branches: - master jobs: build_and_push: name: Build and Push runs-on: ubuntu-latest steps: - name: Docker Build uses: "actions/docker/cli@master" with: args: build . --file Dockerfile -t cflynnus/blog:`echo ${GITHUB_REF} | cut -d'/' -f3`-${GITHUB_SHA}

How to get current branch within github actions

≯℡__Kan透↙ 提交于 2019-12-29 05:21:55
问题 I'm building docker images with Github Actions and want to tags images with branch name, I found only GITHUB_REF variable, but it results in refs/heads/feature-branch-1 and I need only feature-branch-1 . 回答1: I added a separate step for extracting branch name from $GITHUB_REF and set it to the step output - name: Extract branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch after that, I can use it in the next steps with - name:

Push to origin from GitHub action

拈花ヽ惹草 提交于 2019-12-28 04:27:28
问题 I'm trying to push to origin remote from GitHub action. The logic of my action is: handle pull_request_review events and filter by comment message checkout to master, merge PR branch, run some checks and push it to origin The script is: if [[ "${GITHUB_EVENT_NAME}" != "pull_request_review" ]]; then echo "unsupported event: ${GITHUB_EVENT_NAME}" exit 1 fi user=$(jq -r .review.user.login ${GITHUB_EVENT_PATH}) cmd=$(jq -r .review.body ${GITHUB_EVENT_PATH}) echo "reviewer is ${user}, command is $

Dockerfile COPY failed: stat no such file, when using GitHub CI

不羁的心 提交于 2019-12-24 06:32:43
问题 I am using GitHub Actions for Gradle project with this given steps: name: Java CI on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - run: gradle wrapper - run: ./gradlew bootJar - run: ls ./build/libs/ - uses: actions/checkout@v1 - name: Login to docker run: docker login docker.pkg.github.com -u xxxxxx -p xxxxxx - uses: actions/checkout@v1 - name: Build the Docker image run: docker build

Dockerfile COPY failed: stat no such file, when using GitHub CI

萝らか妹 提交于 2019-12-24 06:32:38
问题 I am using GitHub Actions for Gradle project with this given steps: name: Java CI on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - run: gradle wrapper - run: ./gradlew bootJar - run: ls ./build/libs/ - uses: actions/checkout@v1 - name: Login to docker run: docker login docker.pkg.github.com -u xxxxxx -p xxxxxx - uses: actions/checkout@v1 - name: Build the Docker image run: docker build