Skip to content

Commit

Permalink
[MISC.] Update sync-branches.yml (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai authored Oct 23, 2024
1 parent 4142ce8 commit f14c287
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 54 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- dev
- stage
- main

jobs:
sync-dev02:
Expand Down Expand Up @@ -54,3 +55,27 @@ jobs:

- name: Push changes to stage02
run: git push origin stage02

sync-main02:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch all branches
run: git fetch --all

- name: Check out main02 branch
run: git checkout main02

- name: Merge main into main02 with theirs strategy
run: git merge origin/main --strategy-option theirs --allow-unrelated-histories

- name: Push changes to main02
run: git push origin main02
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
camelToSentenceCase,
readBlockConfig,
signIn,
getECCEnv,
getEventServiceEnv,
} from '../../scripts/utils.js';
import { SearchablePicker } from '../../components/searchable-picker/searchable-picker.js';
import { FilterMenu } from '../../components/filter-menu/filter-menu.js';
Expand Down Expand Up @@ -715,7 +715,7 @@ export default async function init(el) {

const sp = new URLSearchParams(window.location.search);
const devToken = sp.get('devToken');
if (devToken && getECCEnv() === 'dev') {
if (devToken && getEventServiceEnv() === 'dev') {
buildDashboard(el, config);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions ecc/blocks/ecc-dashboard/ecc-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
getEventPageHost,
readBlockConfig,
signIn,
getECCEnv,
getEventServiceEnv,
} from '../../scripts/utils.js';
import { quickFilter } from '../form-handler/data-handler.js';
import { initProfileLogicTree } from '../../scripts/event-apis.js';
Expand Down Expand Up @@ -719,7 +719,7 @@ export default async function init(el) {

const sp = new URLSearchParams(window.location.search);
const devToken = sp.get('devToken');
if (devToken && getECCEnv() === 'dev') {
if (devToken && getEventServiceEnv() === 'dev') {
buildDashboard(el, config);
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-unused-vars */
import { LIBS } from '../../../scripts/scripts.js';
import HtmlSanitizer from '../../../scripts/deps/html-sanitizer.js';
import { fetchThrottledMemoizedText, getECCEnv } from '../../../scripts/utils.js';
import { fetchThrottledMemoizedText, getEventServiceEnv } from '../../../scripts/utils.js';

const { createTag } = await import(`${LIBS}/utils/utils.js`);

Expand Down Expand Up @@ -35,7 +35,7 @@ async function loadPreview(component, templateId) {

let host;
if (window.location.href.includes('.hlx.')) {
host = window.location.origin.replace(window.location.hostname, `${getECCEnv()}--events-milo--adobecom.hlx.page`);
host = window.location.origin.replace(window.location.hostname, `${getEventServiceEnv()}--events-milo--adobecom.hlx.page`);
} else {
host = window.location.origin;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-unused-vars */
import { createVenue, replaceVenue } from '../../../scripts/esp-controller.js';
import BlockMediator from '../../../scripts/deps/block-mediator.min.js';
import { changeInputValue, getECCEnv, getSecret } from '../../../scripts/utils.js';
import { changeInputValue, getEventServiceEnv, getSecret } from '../../../scripts/utils.js';
import { buildErrorMessage } from '../form-handler.js';

function togglePrefillableFieldsHiddenState(component) {
Expand All @@ -20,7 +20,7 @@ function togglePrefillableFieldsHiddenState(component) {

async function loadGoogleMapsAPI(callback) {
const script = document.createElement('script');
const apiKey = await getSecret(`${getECCEnv()}-google-places-api`);
const apiKey = await getSecret(`${getEventServiceEnv()}-google-places-api`);
script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places&callback=onGoogleMapsApiLoaded`;
script.async = true;
script.defer = true;
Expand Down
4 changes: 2 additions & 2 deletions ecc/blocks/form-handler/form-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
camelToSentenceCase,
getEventPageHost,
signIn,
getECCEnv,
getEventServiceEnv,
} from '../../scripts/utils.js';
import {
createEvent,
Expand Down Expand Up @@ -860,7 +860,7 @@ export default async function init(el) {

const sp = new URLSearchParams(window.location.search);
const devToken = sp.get('devToken');
if (devToken && getECCEnv() === 'dev') {
if (devToken && getEventServiceEnv() === 'dev') {
buildECCForm(el).then(() => {
el.classList.remove('loading');
});
Expand Down
Loading

0 comments on commit f14c287

Please sign in to comment.