Github Actions: missing telegram token or user list - telegram

I'm trying to use Github Actions to send a Telegram message every time someone pushes to the master of repo. But using this action causes the following error and action fails:
missing telegram token or user list
Here is my yml file:
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Telegram Notify
uses: appleboy/telegram-action#0.0.3
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
An event occured in ${{ github.repository }} repository.
${{ github.event_name }}
I quite new in Github Actions. What should I do to fix this?
P.S: I've added telegram_token and telegram_chat_id to secrets section of repo.

Go to the repo settings and set the secrets for the TELEGRAM_CHAT_ID and the TELEGRAM_TOKEN. when setting the secrets for TELEGRAM_TOKEN make sure to send the queries to the Telegram Bot API using the bot token https://api.telegram.org/bot/METHOD_NAME, for example https://api.telegram.org/bot19023205:BNF-23dred1234ghIkl-dre4fdgr8nv1w4od/getMe

Related

Unable to resolve action `google-github-actions/setup-gcloud#master`, unable to find version `master`

I'm using this code in Github actions to Backup firebase on Google Cloud
name: Backup Firestore
on:
schedule:
- cron: '41 16 * * *'
env:
PROJECT_ID: polydds-b712c
BUCKET: gs://backup_polydts01
jobs:
backup:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/setup-gcloud#master
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- run: gcloud info
- run: gcloud config set project $PROJECT_ID
- run: gcloud firestore export $BUCKET
However I get this error
Unable to resolve action google-github-actions/setup-gcloud#master, unable to find version master
I changed master to main and v1 to test if it works
I got this error
Run gcloud firestore export $BUCKET
gcloud firestore export $BUCKET
shell: /usr/bin/bash -e {0}
env:
PROJECT_ID: polydds-b712c
BUCKET: gs://backup_polydts01
CLOUDSDK_METRICS_ENVIRONMENT: github-actions-setup-gcloud
CLOUDSDK_METRICS_ENVIRONMENT_VERSION: 1.1.0
ERROR: (gcloud.firestore.export) You do not currently have an active account selected.
Please run:
$ gcloud auth login
to obtain new credentials.
If you have already logged in with a different account:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
Error: Process completed with exit code 1.
I have no clue what's wrong?
My Master branch is up to date and working
any help would be much appreciated

how to use pat token to clone private repo through GitHub actions.?

name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout#v2
# Runs a single command using the runners shell
- name: terratest
run: echo Github pat token is ${{ secrets.TF_GITHUB_PAT }}
- name: checkout t2form-k8s repo
uses: actions/checkout#v2
with:
repository: harikalyank/t2form-k8s
token: ${{ secrets.TF_GITHUB_PAT }}
ref: master
The above one is my GH-workflow and it's getting failed to clone repo:t2form-k8s.
error: Warning: The save-state command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Error: Input required and not supplied: token
I created Pat/secret token as well on repository level with name:TF_GITHUB_PAT

GitHub action stalls on setup-r-dependencies#v2

This is cross posted on the RStudio Community site. I am using r-lib/setup-r-dependencies#v2 for a bookdown project on GitHub action. However, the job is stalling when pak tries to create a lock file. Here is an example run , and here is the workflow.
As you can see, eventually the job just times out.
The issue seems similar to this post. The solution there was to use the most current RSPM, but I believe that is already what I am using (I don't specify anything different in the workflow).
Any ideas on what might be causing this?
Edit: Here is the full yaml code for the workflow (linked above)
on:
push:
branches: [main, master]
workflow_dispatch:
name: bookdown
jobs:
bookdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout#v2
- uses: r-lib/actions/setup-pandoc#v2
- uses: r-lib/actions/setup-r#v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies#v2
with:
cache-version: 1
- name: Cache bookdown results
uses: actions/cache#v2
with:
path: _bookdown_files
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-
- name: Build site
run: bookdown::render_book("index.Rmd", quiet = TRUE)
shell: Rscript {0}
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action#4.1.4
with:
branch: gh-pages
folder: _book

How to only run Firebase GitHub action if a commit was verified?

I have this default Firebase deploy-on-push workflow that does a great job updating my site whenever I push my code to my GitHub repository. However, I'd like to update the workflow such that my site is only updated if the commit was verified, as I don't want any unverified committers having the ability to update the site. (Of course, if a verified committer commits after an unverified committer, the whole site should update with the latest changes.)
The workflow is below.
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- uses: FirebaseExtended/action-hosting-deploy#v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WOOSTER_TRADING_SYSTEMS }}'
channelId: live
projectId: wooster-trading-systems
Is this even possible? Can you do actions conditionally, and can you distinguish between unverified and verified committers inside the YAML setup?

Github actions Runner listener exited with error code null

In my server, if I run
sudo ./svc.sh status
I got this
It says status is active. But Runner listener exited with error code null
In my, Github accounts actions page runner is offline.
The runner should be Idle as far as I know.
This is my workflow
name: Node.js CI
on:
push:
branches: [ dev ]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [ 12.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node-version }}
Here I don't have any build scripts because I directly push the build folder to Github repo.
How do I fix this error?
I ran into this issue when I first installed the runner application under $USER1 but configured it as a service when I was $USER2.
In the end, I ran cd /home/$USER1/actions-runner && sudo ./svc.sh uninstall to remove the service.
Changed the owner of the all files in the /home/$USER1/actions-runner/ by
sudo chown -R $USER2 /home/$USER1/actions-runner.
And ran ./config.sh remove --token $HASHNUBER (you can get this by following this page) to removed all the runner application.
I also removed it from github settings runner page.
In the end, I installed eveything again as the same user, and it worked out.
I ran into this same issue and it turned out to be a disk space problem. Make sure your server has enough allocated storage.

Resources