Skip to content

Commit

Permalink
Merge branch 'main' into GuessTheSong-PR1
Browse files Browse the repository at this point in the history
  • Loading branch information
Damini2004 authored Jun 2, 2024
2 parents a709259 + 70f7afa commit 69cdcb3
Show file tree
Hide file tree
Showing 65 changed files with 2,544 additions and 1,363 deletions.
132 changes: 66 additions & 66 deletions .github/workflows/pr_tags.yaml
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
name: Pull Request Labels
# name: Pull Request Labels

on:
pull_request_target:
types:
- opened
- synchronize
# on:
# pull_request_target:
# types:
# - opened
# - synchronize

jobs:
pr-validation:
runs-on: ubuntu-latest
# jobs:
# pr-validation:
# runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '14'

- name: Install dependencies
run: npm install --prefix .github octokit
# - name: Install dependencies
# run: npm install --prefix .github octokit

- name: Fetch related issue and labels
id: fetch_issue
uses: actions/github-script@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const prNumber = context.payload.pull_request.number;
const repoOwner = context.payload.repository.owner.login;
const repoName = context.payload.repository.name;
# - name: Fetch related issue and labels
# id: fetch_issue
# uses: actions/github-script@v4
# with:
# github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# script: |
# const prNumber = context.payload.pull_request.number;
# const repoOwner = context.payload.repository.owner.login;
# const repoName = context.payload.repository.name;

const { data: pr } = await github.pulls.get({
owner: repoOwner,
repo: repoName,
pull_number: prNumber
});
# const { data: pr } = await github.pulls.get({
# owner: repoOwner,
# repo: repoName,
# pull_number: prNumber
# });

const issueNumber = pr.body.match(/#([0-9]+)/)[1];
# const issueNumber = pr.body.match(/#([0-9]+)/)[1];

const { data: issue } = await github.issues.get({
owner: repoOwner,
repo: repoName,
issue_number: issueNumber
});
# const { data: issue } = await github.issues.get({
# owner: repoOwner,
# repo: repoName,
# issue_number: issueNumber
# });

return {
issue: issue,
prNumber: prNumber,
repoOwner: repoOwner,
repoName: repoName
};
# return {
# issue: issue,
# prNumber: prNumber,
# repoOwner: repoOwner,
# repoName: repoName
# };

- name: Apply labels to PR
if: |
steps.fetch_issue.outputs.issue.labels.some(function(label) {
return label.name.toLowerCase() === 'gssoc';
})
run: |
const issueLabels = steps.fetch_issue.outputs.issue.labels;
const prNumber = steps.fetch_issue.outputs.prNumber;
const repoOwner = steps.fetch_issue.outputs.repoOwner;
const repoName = steps.fetch_issue.outputs.repoName;
# - name: Apply labels to PR
# if: |
# steps.fetch_issue.outputs.issue.labels.some(function(label) {
# return label.name.toLowerCase() === 'gssoc';
# })
# run: |
# const issueLabels = steps.fetch_issue.outputs.issue.labels;
# const prNumber = steps.fetch_issue.outputs.prNumber;
# const repoOwner = steps.fetch_issue.outputs.repoOwner;
# const repoName = steps.fetch_issue.outputs.repoName;

const prLabels = issueLabels.filter(function(label) {
return label.name.toLowerCase().startsWith('level');
});
prLabels.push('gssoc');
await github.issues.addLabels({
owner: repoOwner,
repo: repoName,
issue_number: prNumber,
labels: prLabels.map(function(label) {
return label.name;
})
});
# const prLabels = issueLabels.filter(function(label) {
# return label.name.toLowerCase().startsWith('level');
# });
# prLabels.push('gssoc');
# await github.issues.addLabels({
# owner: repoOwner,
# repo: repoName,
# issue_number: prNumber,
# labels: prLabels.map(function(label) {
# return label.name;
# })
# });
1 change: 1 addition & 0 deletions Games/2048/style/helpers.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Games/2048/style/helpers.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 69cdcb3

Please sign in to comment.