diff --git a/.github/workflows/first-github-rest-api-call.yaml b/.github/workflows/first-github-rest-api-call.yaml index 00a96b1..19f0c8a 100644 --- a/.github/workflows/first-github-rest-api-call.yaml +++ b/.github/workflows/first-github-rest-api-call.yaml @@ -11,8 +11,12 @@ jobs: uses: actions/checkout@v4 - name: run bash script run: | - bash github_rest_api.sh - with: - GITHUB_ + echo hello + - name: branch name + run: + echo "$GITHUB_REF branch" + - name: branch names + run: + echo "$GITHUB_REF_TYPE branch" diff --git a/.github/workflows/self-hosted-check.yaml b/.github/workflows/self-hosted-check.yaml new file mode 100644 index 0000000..e9e96f2 --- /dev/null +++ b/.github/workflows/self-hosted-check.yaml @@ -0,0 +1,25 @@ +name: Azure Auth and az account show on selfhosted runner + +on: +# push: + workflow_dispatch: + +jobs: + azure-auth: + runs-on: self-hosted + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Azure CLI script + uses: azure/cli@v2 + with: + azcliversion: latest + inlineScript: | + az login --service-principal -u ${{ secrets.ARM_CLIENT_ID }} -p ${{ secrets.ARM_CLIENT_SECRET }} --tenant ${{ secrets.ARM_TENANT_ID }} + az account set --subscription ${{ secrets.ARM_SUBSCRIPTION_ID }} + az account show -o json + + - name: Completed + run: echo 'completed' diff --git a/.github/workflows/sendgrid.yaml b/.github/workflows/sendgrid.yaml new file mode 100644 index 0000000..10b6a95 --- /dev/null +++ b/.github/workflows/sendgrid.yaml @@ -0,0 +1,47 @@ +name: send-email +on: + workflow_dispatch: + +jobs: + send-email: + # runs-on: ubuntu-latest + + # steps: + # - uses: githubofkrishnadhas/github-access-using-githubapp@v2 + # id: token-generation + # with: + # github_app_id: ${{ secrets.TOKEN_GENERATOR_APPID }} + # github_app_private_key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }} + + # - name: Checkout Repository + # uses: actions/checkout@v4 + # with: + # repository: 'devwithkrishna/sendgrid-docker-image' + # token: ${{ steps.token-generation.outputs.token }} + # fetch-depth: 1 + + # - name: set up python + # uses: actions/setup-python@v2 + # with: + # python-version: '3.11' + + # - name: package installations + # run: | + # pip install poetry + # poetry -v install --no-ansi --no-interaction --only main + + # - name: run python program + # env: + # SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }} + # run: | + # poetry run python3 sendgrid_email.py --subject "${{ inputs.subject }}" --recepient "${{ inputs.recepient }}" --email_body "${{ inputs.email_body }}" --cced "${{ inputs.cced }}" + uses: devwithkrishna/sendgrid-docker-image/.github/workflows/send_email.yaml@main + secrets: inherit + with: + subject: "shdbadbsadh" + recepient: "krishnadhasnk1997@gmail.com" + email_body: "awdsadsd" + cced: "" + + # - name: program execution completed + # run: echo "program execution completed" diff --git a/.github/workflows/slack-action-check.yml b/.github/workflows/slack-action-check.yml new file mode 100644 index 0000000..365b6c2 --- /dev/null +++ b/.github/workflows/slack-action-check.yml @@ -0,0 +1,45 @@ +name: slack action check +on: + workflow_dispatch: + inputs: + channel_id: + default: 'C07EVSM8EUS' + type: string + bot_name: + default: 'alerts-bot' + type: string + file_name: + default: 'a.txt, b.txt' + type: string +jobs: + slack-check: + runs-on: ubuntu-latest + steps: + - name: Token generator + uses: githubofkrishnadhas/github-access-using-githubapp@v2 + id: token-generation + with: + github_app_id: ${{ secrets.TOKEN_GENERATOR_APPID }} + github_app_private_key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }} + + - name: Checkout Repository + uses: actions/checkout@v4 + with: + token: ${{ steps.token-generation.outputs.token }} + + - name: create files + run: | + echo "This is test 1 actions repo" > a.txt + echo "I am awesome.txt. All good confirmed" > bb.txt + echo "this is verification from slack action. All good confirmed" > b.txt + ls -la + sleep 10 + + - name: slack test + uses: devwithkrishna/send-notifications-to-slack-from-github@main + env: + SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} + with: + channel_id: ${{ inputs.channel_id }} + bot_name: ${{ inputs.bot_name }} + file_name: ${{ inputs.file_name }}