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

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

Related

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

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.

AWS 'eb init' not a valid key=value pair (missing equal-sign) Bitbucket pipelines

I am setting up Bitbucket pipeline for a Wordpress deployment on Elastic Beanstalk.
This error message pops up in line eb init --region AWS_DEFAULT_REGION --platform php-5.5 :
ERROR: ServiceError - '/20200712/$AWS_DEFAULT_REGION/elasticbeanstalk/aws4_request' not a valid key=value pair (missing equal-sign) in Authorization header: 'AWS4-HMAC-SHA256 Credential=$AWS_ACCESS_KEY_ID/20200712/$AWS_DEFAULT_REGION/elasticbeanstalk/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=3d7fef....8383d5'.
Other relevant questions and why it doesn't solve my problem :
1 2 : Don't have /.aws/config in Bitbucket environment
3 : Error message mentioned above
The Bitbucket pipeline till now :
image: tyrellsys/aws-ebcli
pipelines:
branches:
master:
- step:
script:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION
- export APPLICATION_NAME=$APPLICATION_NAME
- export ENVIRONMENT_NAME=$ENVIRONMENT_NAME
- eb init --region ap-southeast-1 --platform php-5.5
- eb deploy wordpress-beanstalk
Based on the comments.
The issue was related to incorrectly set $AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY and $AWS_DEFAULT_REGION.
Fixing the values was the solution to the reported issue with key=value pair (missing equal-sign).

Github Actions: missing telegram token or user list

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

Resources