Skip to content

Commit cac0523

Browse files
authored
Merge pull request #3 from fredfrazao/test/test-action
test
2 parents 95f2a1d + 27d81ac commit cac0523

18 files changed

Lines changed: 2290 additions & 18 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: "upload-batch"
3+
description: "blob upload-batch"
4+
inputs:
5+
BLOB_CONTAINER_URL:
6+
description: "BLOB_CONTAINER_URL"
7+
required: true
8+
AZURE_STORAGE_DESTINATION_FOLDER:
9+
description: "AZURE_STORAGE_DESTINATION_FOLDER"
10+
required: true
11+
SOURCE:
12+
description: "source"
13+
required: true
14+
AZURE-CREDENTIALS :
15+
description: "azure-credentials"
16+
required: true
17+
UPLOAD_ENABLED :
18+
description: "upload enabled"
19+
required: true
20+
AUTH_MOD :
21+
description: "auth_mod"
22+
required: false
23+
default: login
24+
AZ_FUNCTION :
25+
description: "az function"
26+
required: false
27+
default: blob
28+
AZ_SUB_FUNCTION :
29+
description: "az az sub function"
30+
required: false
31+
default: upload-batch
32+
33+
34+
runs:
35+
using: "composite"
36+
steps:
37+
- name: Install azure-cli
38+
uses: elstudio/action-install-azure-cli@v1
39+
40+
- name: Login via Azure CLI
41+
uses: azure/login@v1.4.6
42+
with:
43+
creds: ${{ inputs.AZURE-CREDENTIALS }}
44+
45+
- name: Upload to Storage account
46+
if: github.event.inputs.upload_enabled == 'true'
47+
shell: bash
48+
env:
49+
BLOB_CONTAINER_URL: ${{ inputs.BLOB_CONTAINER_URL }}
50+
AZURE_STORAGE_DESTINATION_FOLDER: ${{ inputs.AZURE_STORAGE_DESTINATION_FOLDER }}
51+
run: |
52+
az storage ${{ inputs.AZ_FUNCTION }} ${{ inputs.AZ_SUB_FUNCTION }} \
53+
--auth-mode ${{ inputs.AUTH_MOD }} \
54+
--source ${{ inputs.SOURCE }} \
55+
--destination ${{ inputs.BLOB_CONTAINER_URL }} \
56+
--destination-path ${{ inputs.AZURE_STORAGE_DESTINATION_FOLDER }} \
57+
--overwrite true
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: "Generate Azure credentials JSON & login"
3+
description: "Generate Azure credentials JSON & login "
4+
inputs:
5+
ARM_CLIENT_ID:
6+
description: "ARM client id"
7+
required: true
8+
ARM_CLIENT_SECRET:
9+
description: "ARM client secret"
10+
required: true
11+
ARM_SUBSCRIPTION_ID:
12+
description: "ARM subscription id "
13+
required: true
14+
ARM_TENANT_ID:
15+
description: "ARM tenant id"
16+
required: true
17+
18+
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Generate Azure credentials JSON
23+
shell: bash
24+
run: |
25+
JSON=$(jq -n -c \
26+
--arg clientId "${{ inputs.ARM_CLIENT_ID }}" \
27+
--arg clientSecret "${{ inputs.ARM_CLIENT_SECRET }}" \
28+
--arg subscriptionId "${{ inputs.ARM_SUBSCRIPTION_ID }}" \
29+
--arg tenantId "${{ inputs.ARM_TENANT_ID }}" \
30+
'$ARGS.named')
31+
echo AZ_CREDENTIALS=$JSON >> $GITHUB_ENV
32+
33+
- name: Login via Azure CLI
34+
uses: azure/login@v1.4.6
35+
with:
36+
creds: ${{ env.AZ_CREDENTIALS }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: debug
2+
"on": workflow_dispatch
3+
jobs:
4+
issue_245:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
with:
9+
ref: debug
10+
- run: npm ci
11+
- run: npm run build
12+
- uses: ./
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
with:
16+
title: Debug
17+
body: "debugging #245"
18+
branch: debug-issue-245
19+
path: test.txt
20+
commit-message: debug
21+
author: Gregor Martynus <39992+gr2m@users.noreply.github.com>
22+
reviewers: gr2m
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"on":
2+
push:
3+
branches:
4+
- master
5+
name: release
6+
jobs:
7+
release:
8+
name: release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: lts/*
15+
cache: npm
16+
- run: npm ci
17+
- run: npm run build
18+
- run: rm .gitignore
19+
- run: npx semantic-release
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
- run: |
23+
git config user.name github-actions
24+
git config user.email github-actions@github.com
25+
git add .gitignore dist/
26+
git commit -m "build"
27+
- run: >-
28+
git push -f
29+
https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
30+
HEAD:refs/heads/v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
- run: >-
34+
git push -f
35+
https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
36+
HEAD:refs/heads/v1.x
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)