【问题标题】:GitHub Tag action does not add tagGitHub 标记操作不添加标记
【发布时间】:2020-12-10 09:35:05
【问题描述】:

我正在尝试为所有通过检查的提交添加标签。我从一个包含测试的模板开始。

一切都按预期运行,但是,当我检查标签时,它没有显示任何已添加。

这是我完整的build.yml

# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

name: build
on:
  pull_request:
    branches: ['*']
  push:
    branches: ['master']

jobs:
  build:
    strategy:
      matrix:
        # Use these Java versions
        java: [
          1.8,  # Minimum supported by Minecraft
          11,   # Current Java LTS
          15    # Latest version
        ]
        # and run on both Linux and Windows
        os: [ubuntu-20.04, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: bump version and push tag
        id: tag_version
        if: ${{ github.event_name == 'push' && runner.os == 'Linux' && matrix.java == '11' }}
        uses: mathieudutour/github-tag-action@v5.1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          create_annotated_tag: true
      - name: validate gradle wrapper
        uses: gradle/wrapper-validation-action@v1
      - name: setup jdk ${{ matrix.java }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: make gradle wrapper executable
        if: ${{ runner.os != 'Windows' }}
        run: chmod +x ./gradlew
      - name: build
        run: ./gradlew build
      - name: capture build artifacts
        if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
        uses: actions/upload-artifact@v2
        with:
          name: Artifacts
          path: build/libs/

这是我运行的操作:https://github.com/cloewen8/Corntopia/actions

在过去的一个小时里,我一直在努力让它发挥作用。我尝试在结帐后将“bump version and push tag”任务从末尾移动到右侧,添加和删除id,更改为github_token定义,使标签注释,尝试任务的先前版本,使用标签在一个版本中(说 new_tag 没有定义),甚至完全按照为任务提供的示例。

我做错了吗?还有什么我应该尝试的吗?

【问题讨论】:

    标签: github-actions


    【解决方案1】:

    看起来这是行动本身的问题。因为它没有正确创建标签。

    我(几乎)得到了它

    - name: Bump version and push tag
            if: ${{ github.event_name == 'push' && runner.os == 'Linux' && matrix.java == '11' }}
            uses: anothrNick/github-tag-action@1.26.0
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              WITH_V: true
    
    Is master a match for main
    pre_release = true
    From https://github.com/kmadof/github-actions-manual
     * [new branch]      kmadof-patch-1 -> origin/kmadof-patch-1
     * [new branch]      test           -> origin/test
     * [new tag]         v1.4           -> v1.4
     * [new tag]         v1.5           -> v1.5
     * [new tag]         v1.6           -> v1.6
     * [new tag]         v1.7           -> v1.7
     * [new tag]         v1.8           -> v1.8
     * [new tag]         v1.9           -> v1.9
     * [new tag]         v1.91          -> v1.91
     * [new tag]         v1.92          -> v1.92
     * [new tag]         v1.93          -> v1.93
     * [new tag]         v1.94          -> v1.94
    fatal: ambiguous argument '0.0.0': unknown revision or path not in the working tree.
    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'
    [main] Modified SO workflow [skip ci]
    minor
    v0.1.0-3ef4b69
    This branch is not a release branch. Skipping the tag creation.
    

    但这对于我在这个 repo 中的一团糟 :)

    总结一下,请尝试使用anothrNick/github-tag-action@1.26.0 并报告mathieudutour/github-tag-action@v5.1 的问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-20
      • 2018-10-11
      相关资源
      最近更新 更多