mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-25 15:41:02 -05:00
cleaner (#1348)
This commit is contained in:
parent
7b8e3189d8
commit
7d5aaba171
1 changed files with 11 additions and 64 deletions
75
.github/workflows/deploy-PROD.yml
vendored
75
.github/workflows/deploy-PROD.yml
vendored
|
@ -81,25 +81,6 @@ jobs:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
env: Production
|
env: Production
|
||||||
|
|
||||||
#######################################################
|
|
||||||
# Create a GitHub Issue with the info from this build #
|
|
||||||
#######################################################
|
|
||||||
- name: Create GitHub Issue
|
|
||||||
uses: actions/github-script@v3.1.0
|
|
||||||
id: create-issue
|
|
||||||
with:
|
|
||||||
# https://octokit.github.io/rest.js/v18#issues-create
|
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
script: |
|
|
||||||
const create = await github.issues.create({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
title: "Deploying to production",
|
|
||||||
body: 'Currently deploying...'
|
|
||||||
})
|
|
||||||
console.log('create', create)
|
|
||||||
return create.data.number
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Build and Push containers to registries #
|
# Build and Push containers to registries #
|
||||||
###########################################
|
###########################################
|
||||||
|
@ -119,59 +100,25 @@ jobs:
|
||||||
ghcr.io/github/super-linter:latest
|
ghcr.io/github/super-linter:latest
|
||||||
ghcr.io/github/super-linter:v3
|
ghcr.io/github/super-linter:v3
|
||||||
|
|
||||||
########################################
|
#######################################################
|
||||||
# Update the issue with success status #
|
# Create a GitHub Issue with the info from this build #
|
||||||
########################################
|
#######################################################
|
||||||
- name: Update issue success
|
- name: Create GitHub Issue for failure
|
||||||
uses: actions/github-script@v3.1.0
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
# https://octokit.github.io/rest.js/v18#issues-create
|
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
script: |
|
|
||||||
github.issues.createComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: "${{ steps.create-issue.outputs.result }}",
|
|
||||||
title: "New issue created",
|
|
||||||
body: "Successfuly deployed to production"
|
|
||||||
})
|
|
||||||
|
|
||||||
############################
|
|
||||||
# Close issue from success #
|
|
||||||
############################
|
|
||||||
- name: Close issue success
|
|
||||||
uses: actions/github-script@v3.1.0
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
# https://octokit.github.io/rest.js/v18#issues-create
|
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
script: |
|
|
||||||
github.issues.update({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: "${{ steps.create-issue.outputs.result }}",
|
|
||||||
state: "closed"
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Update the issue with failure status #
|
|
||||||
########################################
|
|
||||||
- name: Update issue failure
|
|
||||||
uses: actions/github-script@v3.1.0
|
|
||||||
if: failure()
|
if: failure()
|
||||||
|
uses: actions/github-script@v3.1.0
|
||||||
|
id: create-issue
|
||||||
with:
|
with:
|
||||||
# https://octokit.github.io/rest.js/v18#issues-create
|
# https://octokit.github.io/rest.js/v18#issues-create
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
script: |
|
script: |
|
||||||
github.issues.createComment({
|
const create = await github.issues.create({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: "${{ steps.create-issue.outputs.result }}",
|
title: "Failed to deploy to production",
|
||||||
title: "New issue created",
|
body: 'Automation has failed us!'
|
||||||
body: "Failed to deploy to production"
|
|
||||||
})
|
})
|
||||||
|
console.log('create', create)
|
||||||
|
return create.data.number
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# Assign admins on failure #
|
# Assign admins on failure #
|
||||||
|
|
Loading…
Reference in a new issue