1 Star 0 Fork 0

x-cmd/action

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
action.yml 4.11 KB
一键复制 编辑 原始数据 按行查看 历史
Aben 提交于 2025-01-17 00:18 +08:00 . fix: upgrade v2 to actions/upload-artifact@v3
name: X-Action
description: X-Action
inputs:
prehook:
description: shell code before execution of entrypoint
required: false
script:
description: script for execution with bash
required: false
code:
description: shell code for execution
required: false
posthook:
description: shell code after execution of entrypoint
required: false
ws_owner_repo:
description: <owner>/<repo>
required: false
ws_repo_ref:
description: repo ref like branch, tag, or other kinds of reference
required: false
github_token:
description: github access token
required: false
ssh_key:
description: ssh key
required: false
git_user:
description: Git Commit Username
required: false
git_email:
description: Git Commit Email
required: false
docker_username:
description: Username for Docker login
required: false
docker_password:
description: Password for Docker login
required: false
docker_buildx_init:
description: buildx init
required: false
artifact_name:
description: artifact_name, default is "artifact"
required: false
artifact_path:
description: artifact_path, default is "~/ws/.artifact"
required: false
artifact_not_found:
description: "Candidates: [warn | error | ignore]"
required: false
artifact_retention_days:
description: "Retention days: 1-90"
required: false
issue_trigger:
description: "[fail | always | never]"
required: false
issue_title:
description: title of issue opening
required: false
issue_assignees:
description: assignees for issue
required: false
issue_template:
description: template
required: false
runs:
using: "composite"
steps:
- name: init x-cmd, git, docker, ssh
shell: bash
env:
github_token: ${{ inputs.github_token || env.github_token }}
ssh_key: ${{ inputs.ssh_key || env.ssh_key }}
ws_owner_repo: ${{ inputs.ws_owner_repo || env.ws_owner_repo || github.repository }}
ws_repo_ref: ${{ inputs.ws_repo_ref || env.ws_repo_ref || github.head_ref || github.ref_name }}
git_user: ${{ inputs.git_user || env.git_user || github.event.head_commit.author.name }}
git_email: ${{ inputs.git_email || env.git_email || github.event.head_commit.author.email }}
docker_username: ${{ inputs.docker_username || env.docker_username }}
docker_password: ${{ inputs.docker_password || env.docker_password }}
docker_buildx_init: ${{ inputs.docker_buildx_init || env.docker_buildx_init }}
___X_CMD_LOG_C_TF: "1"
___X_CMD_GHACTION_INSIDE: "1"
run: |
curl -s https://raw.githubusercontent.com/x-cmd/action/main/lib/index.sh > ~/xghaction
. ~/xghaction init
- name: Running Script
shell: bash
env:
___X_CMD_GHACTION_PREHOOK: ${{ inputs.prehook || env.prehook }}
___X_CMD_GHACTION_SCRIPT: ${{ inputs.script || env.script || format( '.x-cmd/{0}', github.job ) }}
___X_CMD_GHACTION_CODE: '${{ inputs.code }}'
___X_CMD_GHACTION_POSTHOOK: ${{ inputs.posthook || env.posthook }}
___X_CMD_LOG_C_TF: "1"
___X_CMD_GHACTION_INSIDE: "1"
run: . ~/xghaction run
- name: Store Artifact
uses: actions/upload-artifact@v4
id: upload
with:
name: ${{ inputs.artifact_name || env.artifact_name || 'artifact' }}
path: ${{ inputs.artifact_path || '~/ws/.artifact' }}
if-no-files-found: ${{ inputs.artifact_not_found || 'ignore' }}
retention-days: ${{ inputs.artifact_retention_days || env.artifact_retention_days || '10' }}
# Should Upload the artifact using the issue api
# - uses: actions/checkout@v2
# - name: Issue To Preserve
# if: ${{ ( inputs.issue_trigger || env.issue_trigger || 'never' ) != 'never' }}
# uses: JasonEtco/create-an-issue@v2
# with:
# assignees: ${{ inputs.issue_assignees || env.issue_assignees }}
# milestone: ${{ inputs.issue_milestone || env.issue_milestone }}
# filename: ${{ inputs.issue_template || env.issue_template }}
# update_existing: true
# search_existing: "all"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/x-cmd/action.git
git@gitee.com:x-cmd/action.git
x-cmd
action
action
main

搜索帮助