initial commit
This commit is contained in:
38
utils/chown/action.yaml
Normal file
38
utils/chown/action.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
name: chown
|
||||
description: "Take or change ownership of the specified files."
|
||||
inputs:
|
||||
uid:
|
||||
description: "User id."
|
||||
required: false
|
||||
default: ""
|
||||
gid:
|
||||
description: "Group id."
|
||||
required: false
|
||||
default: ""
|
||||
file:
|
||||
description: "File or folder to own."
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Determine UID and GID."
|
||||
id: ids
|
||||
run: |
|
||||
USER_UID="${{ inputs.uid }}"
|
||||
USER_GID="${{ inputs.gid }}"
|
||||
if [[ -z "$USER_UID" ]]; then
|
||||
USER_UID=$(id -u)
|
||||
fi
|
||||
if [[ -z "$USER_GID" ]]; then
|
||||
USER_GID=$(id -g)
|
||||
fi
|
||||
|
||||
echo $USER_UID:$USER_GID
|
||||
|
||||
echo "::set-output name=uid::$USER_UID"
|
||||
echo "::set-output name=gid::$USER_GID"
|
||||
shell: bash
|
||||
- name: "Take ownership of output."
|
||||
uses: act/common/distros/busybox@master
|
||||
with:
|
||||
args: chown ${{ steps.ids.outputs.uid }}:${{ steps.ids.outputs.gid }} "${{ inputs.file }}" -R
|
||||
Reference in New Issue
Block a user