Skip to content

Commit

Permalink
remove
Browse files Browse the repository at this point in the history
  • Loading branch information
byang committed Nov 8, 2024
1 parent 5abfa78 commit 62211db
Showing 1 changed file with 2 additions and 158 deletions.
160 changes: 2 additions & 158 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -1,100 +1,9 @@
# name: Go
# on: [push]

# permissions:
# id-token: write
# contents: read

# jobs:
# test:
# runs-on: ubuntu-latest
# # container: golang:1.19
# steps:
# - name: set oauth env
# run: |
# echo "OAUTH_CLIENT_ID=${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }}" >> $GITHUB_ENV
# echo "OAUTH_CLIENT_SECRET=${{ secrets.TAILSCALE_OAUTH_CLIENT_SECRET }}" >> $GITHUB_ENV

# - name: Connect to Tailscale
# uses: tailscale/github-action@v1
# with:
# authkey: ${{ secrets.TAILSCALE_AUTHKEY }}

# - name: Tailscale status
# run: |
# tailscale netcheck
# tailscale status

# - name: Checkout
# uses: actions/checkout@v3

# - name: Assume github action role
# uses: aws-actions/configure-aws-credentials@v1
# with:
# role-to-assume: "arn:aws:iam::320005014399:role/github-action"
# aws-region: us-east-1

# # should output the ARN of your instance role, if it's now being used
# - name: identity check
# shell: bash
# run: aws sts get-caller-identity

# - name: Assume vault-prod role
# uses: aws-actions/configure-aws-credentials@v1
# with:
# ### IMPORTANT: must pass over these three, otherwise doesn't work
# aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
# aws-session-token: ${{ env.AWS_SESSION_TOKEN }}
# role-to-assume: "arn:aws:iam::320005014399:role/vault-prod"
# # Need to disable since the parent role doesn't have permissions to tag
# role-skip-session-tagging: true
# # role duration need <= the default when creating role
# role-duration-seconds: 3600
# aws-region: us-east-1

# - name: identity check
# shell: bash
# run: aws sts get-caller-identity

# - name: set aws env
# run: |
# echo "AWS_ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }}" >> $GITHUB_ENV
# echo "AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
# echo "AWS_SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }}" >> $GITHUB_ENV
# echo "PERSONAL_VAULT_TOKEN=${{ secrets.PERSONAL_VAULT_TOKEN }}" >> $GITHUB_ENV

# - uses: actions/setup-go@v4
# with:
# go-version: '1.19'
# check-latest: true

# - run: go run main.go

name: "Job to test cron job"
# on:
# workflow_dispatch:
# inputs:
# expiration_days:
# description: 'Auth key expiration days'
# default: "10"
# type: string
# schedule:
# - cron: '30 10 */2 * *'

on:
push:
branches:
- PE-test

# workflow_dispatch:
# inputs:
# expiration_days:
# description: 'Set auth key expiration days'
# default:
# type: string
# schedule:
# - cron: '* */5 * * *'


jobs:
test-job:
Expand All @@ -109,69 +18,4 @@ jobs:
- name: Run Ansible playbook
run: |
echo "${{ steps.get_ref.outputs.* }}"




















# - name: Check if 'times' input exists
# id: check_times_input
# run: echo "::set-output name=times_input_exists::$(echo ${{ github.event.inputs.times != null }})"


- name: Check TAILSCALE_AUTHKEY expiration days(at least 10 days)
run: |
if [[ $EXPIRATION_DAYS -lt 10 ]]; then
echo "Expiration day is less than 10. Throwing an error."
exit 1
else
echo "Expiration is greater than or equal to 10. Proceeding with the workflow."
fi
# - name: Define TAILSCALE_AUTHKEY expiration days(at least 10 days)
# id: check-step
# run: |
# if [ -z "${{ inputs.expiration_days }}" ]; then
# echo "Running with scheduled job, use default value"
# echo "EXPIRATION_DAYS=90" >> $GITHUB_ENV
# echo "UPDATE_THRESHOLD=5" >> $GITHUB_ENV
# echo "::set-output name=skip::skip-next-step"
# fi

# Add your desired steps here
# - name: Run your command or script
# if: steps.check-step.outputs.skip != 'skip-next-step'
# run: |
# # Your command or script here
# if [[ ${{ inputs.expiration_days }} -lt 10 ]]; then
# echo "Expiration day is less than 10. Throwing an error."
# exit 1
# else
# echo "Expiration is greater than or equal to 10. Proceeding with the workflow."
# fi

# echo "Running every 5 minutes"
# echo "The tags are ${{ inputs.expiration_days }} "

- name: Send Slack notification
env:
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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"
SLACK_CHANNEL: "#grafana-pe-alerts"
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"This is a test notification from GitHub Actions. Just ignore it"}' $SLACK_WEBHOOK_URL

0 comments on commit 62211db

Please sign in to comment.